通过CreateUserWizard进行用户注册之前,请检查某些条件 [英] Check certain condition before user-registration through CreateUserWizard
本文介绍了通过CreateUserWizard进行用户注册之前,请检查某些条件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个RadioButtonList和一个CreateUzerWizard.
当用户单击创建用户"向导的创建用户"按钮时,
首先必须确定用户是否选择了任何单选按钮
如果没有,请停止创建用户操作
I have a RadioButtonList and a CreateUzerWizard.
When user click on the createte-user Button of Create-User wizard,
first It has to varify whether user has selected any radio-button
if no stop the create-user action
protected void CreateUserWizard1_CreatingUser(object sender, LoginCancelEventArgs e)
{
if (RadioButtonList1.SelectedIndex == -1)
{ return;//not to proceed
}
}
但是尽管用户未选择单选按钮,但仍在进行创建用户操作.此时如何防止创建用户操作.
感谢您提前提供帮助.
But still though user not select the radiobutton create-user action is taking place. How can I prevent the create-user action at this point.
Thanks for help in advance
推荐答案
添加一行:
Add a line:
protected void CreateUserWizard1_CreatingUser(object sender, LoginCancelEventArgs e)
{
if (RadioButtonList1.SelectedIndex == -1)
{
e.Cancel=true; // <----- Add this line.
return;//not to proceed
}
}
这篇关于通过CreateUserWizard进行用户注册之前,请检查某些条件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文