jQuery 对话框插件问题
我是 jQuery 新手,目前正在使用 Visual Studio 2010 ASP.NET 页面选项卡。在第一(开始)页面中,用户必须输入信息才能访问其他选项卡。如果用户尚未输入任何信息,我想显示某种警报消息,其中显示:请输入您的信息。
我所做的是使用 System.Windows.Forms 实现 MessageBox.Show(),但如果我发布网页,这将不起作用。我应该如何使用 jQuery 对话框插件来做到这一点?
我有这样的事情:
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<script type="text/javascript">
$(function () {
$("#dialog").dialog();
});
</script>
Welcome! Please provide your Number to complete your application:
<asp:TextBox ID="txtSSN" runat="server" TextMode="Password" </asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="txtSSN" ErrorMessage="*"></asp:RequiredFieldValidator>
<asp:Button ID="btnSubmit" runat="server" onclick="btnSubmit_Click"
Text="Submit" />
<div id="dialog" style="display: none; ">
<p>Please Enter Your Credentials First!</p>
</div>
</asp:Content>
I am NEW in jQuery and I am using Visual Studio 2010 ASP.NET Pages Tabs for now. In the first (Start) page User have to enter information to access other tabs. If User has not entered any info I want to show some kind of alert mesg that displays: Please Enter your Info.
What I did is that I implemented MessageBox.Show() using System.Windows.Forms, but that is not gonna work if I am publishing the webpage. How should I do it with jQuery Dialog Box Plugin?
I have something like this:
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<script type="text/javascript">
$(function () {
$("#dialog").dialog();
});
</script>
Welcome! Please provide your Number to complete your application:
<asp:TextBox ID="txtSSN" runat="server" TextMode="Password" </asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="txtSSN" ErrorMessage="*"></asp:RequiredFieldValidator>
<asp:Button ID="btnSubmit" runat="server" onclick="btnSubmit_Click"
Text="Submit" />
<div id="dialog" style="display: none; ">
<p>Please Enter Your Credentials First!</p>
</div>
</asp:Content>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用带有选项 ShowMessageBox="True" 的 ValidationSummary 控件。例如:
如果您没有找到有关如何使用它的教程,请告诉我。
You can use the ValidationSummary control with option ShowMessageBox="True". Something like:
Let me know if you do not find a tutorial on how to use it.