这是代码:
protected void btnProceed_Click(object sender, EventArgs e)
{
if (!Page.IsValid)
{
return;
}
MembershipCreateStatus createstatus;
UserDetails us = new UserDetails();
MembershipUser Newuser = Membership.CreateUser(txtusrname.Text, txtpassword.Text, txtemailid.Text, "Question", "Answer", true, out createstatus);
if (Newuser != null && createstatus == MembershipCreateStatus.Success)
{
if (RdoAuthorReviewer.SelectedValue =="Author")
{
Roles.AddUserToRole(txtusrname.Text, "Author");
}
int NoOfRecordsAffected = us.createUser();
try
{
if (NoOfRecordsAffected > 0)
{
Mail.sendmail();
}
else
{
Response.Redirect("SignUp-Error.aspx",true);
}
}
}
}
}
在 aspx 页面按钮代码上:
<asp:Button ID="btnProceed" runat="server" CssClass="button notransitions" Text="Register User and Send Letter" ValidationGroup="reqGroup" onclick="btnProceed_Click" TabIndex="16" style="width:303px; margin-top:15px;" />
我的要求:
1)单击按钮时,应禁用该按钮或单击按钮时加载图像位于页面中心。