如何解决文件不存在global.asax中的URL路由错误... [英] How to resolve File doesn't exists url routing error in global.asax...

查看:72
本文介绍了如何解决文件不存在global.asax中的URL路由错误...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何解析文件在global.asax中不存在url routing错误...

How to resolve File doesn''t exists url routing error in global.asax...

推荐答案

有一个方法暴露于处理URL'' 。阅读: ResolveUrl [ ^ ]。



您还可以在设置控件/图像源之前查看此提示并正确解析路径:在多文件夹网站中解析路径 [ ^ ]
There is a method exposed to handle URL''s. Have a read: ResolveUrl[^].

You can also have a look at this Tip and resolve the path correctly before setting the control/image source: Resolving Paths in a Multi-Folder WebSite[^]


你可以使用自定义错误也是如此。在web.config文件中设置自定义错误模式。

在此处查看示例:

You can use Custom Errors to do the same. Set the custom error mode on in web.config file.
See an example here:
<customerrors mode="On" redirectmode="ResponseRewrite"><error statuscode="404" redirect="FileNotFound.aspx" /> </customerrors>
<!--Here status code 404 is for file not found error. If any error occurred the page will be redirected to FileNotFound.aspx page-->







--Amit




--Amit


这篇关于如何解决文件不存在global.asax中的URL路由错误...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆