ASP.NET自定义错误处理页面的添加
asp.net自定义错误处理页面方法一
1、添加Web.config, < system.web>< /system.web>中添加< customErrors mode="On"
defaultRedirect="ApplicationErroy.aspx" >< /customErrors>节点,
2、添加错误处理页面:ApplicationErroy.aspx调用下面的方法:
private void DealErroy() { HttpException erroy = new HttpException(); string strCode = erroy.ErrorCode.ToString(); string strMsg = erroy.Message; erroy.HelpLink = "sss"; Response.Write("ErrorCode:" + strCode + "< br>"); Response.Write("Message:" + strMsg + "< br>"); Response.Write("HelpLink:" + erroy.HelpLink + "< br>"); Response.Write("Source:" + erroy.Source + "< br>"); Response.Write("TargetSite:" + erroy.TargetSite + "< br>"); Response.Write("InnerException:" + erroy.InnerException + "< br>"); Response.Write("StackTrace:" + erroy.StackTrace + "< br>"); Response.Write("GetHtmlErrorMessage:" + erroy.GetHtmlErrorMessage() + "< br>"); Response.Write("erroy.GetHttpCode().ToString():" + erroy.GetHttpCode().ToString() + "< br>"); Response.Write("erroy.Data.ToString()::" + erroy.Data.ToString() + "< br>"); }
这种方法不
相关文档:
一、伪静态的用处
有些用户觉得,伪静态和真静态实际被收录量会相差很大,其实不然,从你个人角度,你去判断一下一个帖子到底是真静态还是伪静态?估计很难看得出,因为所谓静态的意思,就是地址中不带问号,不带问号的就是静态,管他是真的还是伪的?搜索引擎看得出吗?所以说,其实不论是真的还是伪的,其实对于搜 ......
首先添加一个模板列,内容如下
<asp:TemplateField HeaderText="操作">
<ItemTemplate>
<div onclick="return confirm('您确定要删除吗?')">
  ......
protected void Button1_Click(object sender, EventArgs e)
{
string fullName = this.File1.PostedFile.FileName;//获取上传文件的全路径
string size = th ......
在开发需要用户注册后才能使用提供的各项功能的应用程序时,在新用户提交注册信息后,较常见的做法是由程序生成随机密码,然后发送密码到用户注册时填写的电子信箱,用户再用收到的密码来激活其帐户。
实现ASP.NET生成随机密码功能是很容易的,下面的代码给出了完整的实现方法:
publicstaticstringMakePassword(st ......