在asp c#中输入对话框 [英] Input dialogbox in asp c#

查看:57
本文介绍了在asp c#中输入对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我正在使用ASP.net创建一个网页。



现在为调用一个特殊功能我喜欢通过提升输入框和获取密码来重新检查用户密码。我有自己的代码来运行后面检查密码。



但是现在我想知道如何调用输入框对话并返回在该输入框中输入的值然后运行我自己的密码检查?

解决方案

Ok
试试这个



 <   html  >  
< body >

< p > 点击按钮展示提示框。< / p >

< 按钮 onclick = myFunction() > 尝试< / button >

< p id = demo > < / p >

< script >
函数myFunction()
{
var x;

var person = prompt(请输入你的名字,哈利波特);

if(person!= null)
{
x =Hello+ person +!你今天好吗?;
document.getElementById(demo)。innerHTML = x;
}
}
< / script >

< / body >
< / html >


您可以检查您在密码文本框中输入的值java脚本的帮助。

 <   html     xmlns   =  http://www.w3.org/1999/xhtml >  
< head runat = server >
< script type = text / javascript language = < span class =code-keyword> javascript >
function myconatrol(){
alert(document.getElementById( TextBox1中)值)。
}

< / script >
< title > < / title >
< / head >
< body >
< 表格 id = form1 runat = server >
< div >
< asp:TextBox ID = TextBox1 runat = server TextMode = 密码 > < / asp:TextBox >

< br / >
< asp:Button ID = < span class =code-keyword> Button1 runat = server OnClientClick = mycontrol() 文字 = 按钮 / >


< / div >
< / form < span class =code-keyword>>
< / body >
< / html >


你应该更好地避免真正的弹出窗口,那些创建一个新的浏览器窗口或选项卡。它们不仅丑陋而且具有侵入性,许多用户会阻止它们。更好地使用jQuery对话框或模态弹出窗口,它模仿同一页面上的模态行为:

http:// jqueryui。 com / dialog / [ ^ ],

http://www.ericmmartin.com/projects/simplemodal-demos/ [ ^ ],

http://www.smashingapps.com/2013/03/14/13-very -useful-jquery-modal-plugins.html [ ^ ],

http://www.jquery4u.com/windows/14-jquery-modal-dialog-boxes/ [ ^ ],

...



你可以找到更多: http://bit.ly/YBKflp [ ^ ]。



-SA

Hello,

I am creating a web page using ASP.net.

Now for call a special function i like to recheck the user password by promoting input box and get password. I have my own code to run behind to check password.

But now i want to know how can i call inputbox dialogue and return value entered in that input box then run my own password check?

解决方案

Ok try this

<html>
<body>

<p>Click the button to demonstrate the prompt box.</p>

<button onclick="myFunction()">Try it</button>

<p id="demo"></p>

<script>
function myFunction()
{
var x;

var person=prompt("Please enter your name","Harry Potter");

if (person!=null)
  {
  x="Hello " + person + "! How are you today?";
  document.getElementById("demo").innerHTML=x;
  }
}
</script>

</body>
</html>


hi you can check value what you enter in password textbox with the help of java script.

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<script type="text/javascript" language="javascript">
    function myconatrol() {
        alert(document.getElementById("TextBox1").value);
    }

</script>
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:TextBox ID="TextBox1" runat="server" TextMode="Password"></asp:TextBox>

        <br />
        <asp:Button ID="Button1" runat="server" OnClientClick="mycontrol()" Text="Button" />


    </div>
    </form>
</body>
</html>


You should better avoid "real" pop-ups, those which create a new browser window or a tab. Not only they are ugly and intrusive, many user will block them. Better use either jQuery dialog or "modal popup" which mimic modal behavior on the same page:
http://jqueryui.com/dialog/[^],
http://www.ericmmartin.com/projects/simplemodal-demos/[^],
http://www.smashingapps.com/2013/03/14/13-very-useful-jquery-modal-plugins.html[^],
http://www.jquery4u.com/windows/14-jquery-modal-dialog-boxes/[^],


You can find more: http://bit.ly/YBKflp[^].

—SA


这篇关于在asp c#中输入对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆