asp.net创建用户控件存在问题
我自定义了asp.net登录控件,它似乎可以创建新帐户,但如果我复制已注册的用户id或输入已使用的电子邮件,则不会显示错误消息。这快把我逼疯了。页面只是刷新,没有显示错误 我已经按照MSDN网站上的说明加入了,但什么都没有asp.net创建用户控件存在问题,asp.net,createuserwizard,Asp.net,Createuserwizard,我自定义了asp.net登录控件,它似乎可以创建新帐户,但如果我复制已注册的用户id或输入已使用的电子邮件,则不会显示错误消息。这快把我逼疯了。页面只是刷新,没有显示错误 我已经按照MSDN网站上的说明加入了,但什么都没有 完成 您的帐户已成功创建。 在MSDN示例中,codebehind中有检查现有用户的代码。您的应用程序中是否有类似的代码?找到了解决方案。CustomNavigationTemplate部分中的按钮似乎需要“MoveNext”的命令参数,并且按钮ID必须由Step
完成
您的帐户已成功创建。
在MSDN示例中,codebehind中有检查现有用户的代码。您的应用程序中是否有类似的代码?找到了解决方案。CustomNavigationTemplate部分中的按钮似乎需要“MoveNext”的命令参数,并且按钮ID必须由StepNextButtonButtonButton提供。我发现了这一点,让控件在没有任何自定义的情况下呈现自己,然后查看其属性
希望这对其他人有所帮助。在asp.net中创建发送邮件的功能 &使用try&catch函数获取用户控件中的错误 如果发现任何错误,则错误会自动发送到您的id 如果您使用gmail,请使用此功能 //声明用于发送邮件的变量 string tomail=您的gmail id string subject=在用户控件中发现错误 string body=用户控件中的异常
// send a mail by gmail account
System.Net.Mail.MailMessage MyMailMessage =
new System.Net.Mail.MailMessage("xyz.com", tomail,
主体、主体);
MyMailMessage.IsBodyHtml=false
//Proper Authentication Details need to be passed when sending email from gmail
System.Net.NetworkCredential mailAuthentication = new
System.Net.NetworkCredential("xyz@gmail.com", "password");
//Smtp Mail server of Gmail is "smpt.gmail.com" and it uses port no. 587
//For different server like yahoo this details changes and you can
//get it from respective server.
System.Net.Mail.SmtpClient mailClient = new System.Net.Mail.SmtpClient("smtp.gmail.com", 587);
//Enable SSL
mailClient.EnableSsl = true;
mailClient.UseDefaultCredentials = false;
mailClient.Credentials = mailAuthentication;
try
{
mailClient.Send(MyMailMessage);
}
catch (System.Net.Mail.SmtpException ex)
{
Response.Write(ex.ToString());
}
}
你能链接到你提到的MSDN文档吗?
//Proper Authentication Details need to be passed when sending email from gmail
System.Net.NetworkCredential mailAuthentication = new
System.Net.NetworkCredential("xyz@gmail.com", "password");
//Smtp Mail server of Gmail is "smpt.gmail.com" and it uses port no. 587
//For different server like yahoo this details changes and you can
//get it from respective server.
System.Net.Mail.SmtpClient mailClient = new System.Net.Mail.SmtpClient("smtp.gmail.com", 587);
//Enable SSL
mailClient.EnableSsl = true;
mailClient.UseDefaultCredentials = false;
mailClient.Credentials = mailAuthentication;
try
{
mailClient.Send(MyMailMessage);
}
catch (System.Net.Mail.SmtpException ex)
{
Response.Write(ex.ToString());
}
}