当模式弹出扩展器处于活动状态时如何显示错误
我有一个 ModalPopupExtender
来创建新用户。当用户输入新的用户详细信息并尝试输入已注册的相同电子邮件 ID 时,我想显示错误。
创建用户:
if (emailcount != 0)
{
Page.ClientScript.RegisterStartupScript(GetType(), "UserDialogScript",
"alert(\"User already exists!\");", true);
}
我检查电子邮件是否已使用,如果已使用,我想弹出错误,但页面保持静止,ModalPopupExtender位于顶部。在那之后我什么也做不了。我怎样才能显示错误?
I have a ModalPopupExtender
to create new users. When the user enters the new user details and tries to enter the same email Id which is already registered then I want to show a error.
Create user:
if (emailcount != 0)
{
Page.ClientScript.RegisterStartupScript(GetType(), "UserDialogScript",
"alert(\"User already exists!\");", true);
}
I check whether the email is already used, if it is used I want to pop up the error but the page stays still with the ModalPopupExtender on the top. I am not able to do anything after that. How can I display the error?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我会为此使用不同的方法。在您的模态弹出扩展程序中,尝试如下操作:
在代码隐藏中:
I would use a different approach for this. In your modal popup extender, try something like this:
In the code-behind: