asp.net里 怎么让点击找不到的页的时候 转向友情提示页面 asp.net里 怎么让点击找不到的页的时候 转向友情提示页面 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <customErrors mode="Off" defaultRedirect="GenericErrorPage.htm"> <error statusCode="403" redirect="NoAccess.htm"/> <error statusCode="404" redirect="FileNotFound.htm"/> </customErrors>我WEBCONfig里这么写的 可是不好使 修改web.config文件中<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm"> <error statusCode="403" redirect="NoAccess.htm" /> <error statusCode="404" redirect="FileNotFound.htm" /> </customErrors>404就表示找不到资源,楼主可以自定义页面 这个只对.aspx的服务器端页面好使.html和.htm的得在IIS中设置 http://msdn.microsoft.com/zh-cn/library/h0hfz6fc(VS.80).aspx <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm"> <error statusCode="403" redirect="NoAccess.htm" /> <error statusCode="404" redirect="FileNotFound.htm" /> </customErrors>application_errorIIS中配置转向页面 UserDB user = new UserDB();if(user.IsValidUserLogIn(texUserName.Text,texPassWord.Text)==true){ FormsAuthentication.SetAuthCookie(texUserName.Text,ture); Session["UserID"]=texUserName.Text; Response.Redirect("SearchCars.aspx");}这个是我的一个页面跳转的页面,就是说如果登入成功,就跳到SearchCars.aspx页面~你可以参考一下这个~~ socket通信 【向各位大大提问】怎样能让DataGridView中的内容垂直显示? 谁给一个匹配类声明的正则表达式. 谢谢 web 弹出文本对话框 SqlHelper 3.0 执行ExecuteReader 不能得到output问题 remoting mediaplayer中如何设置视频循环播放? 请教如何在webform中,调用MessageBox C# repositoryItemHyperLinkEdit去掉下划线 请问“未将对象引用设置到对象的实例”是因为什么引起的? 请教,winform中如何读取excel的某一列值,并存到list中 C#处理网页事件
<error statusCode="403" redirect="NoAccess.htm"/>
<error statusCode="404" redirect="FileNotFound.htm"/>
</customErrors>我WEBCONfig里这么写的 可是不好使
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>404就表示找不到资源,楼主可以自定义页面
.html和.htm的得在IIS中设置
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
application_error
IIS中配置转向页面
UserDB user = new UserDB();
if(user.IsValidUserLogIn(texUserName.Text,texPassWord.Text)==true)
{
FormsAuthentication.SetAuthCookie(texUserName.Text,ture);
Session["UserID"]=texUserName.Text;
Response.Redirect("SearchCars.aspx");
}
这个是我的一个页面跳转的页面,就是说如果登入成功,就跳到SearchCars.aspx页面~
你可以参考一下这个~~