English 中文(简体)
Could I get by HttpModule the URL that contains * before?
原标题:

My web-site is working under ASP.NET 3.5, IIS7, Integrated pipiline mode. My HttpModule is getting request to all resources, including URLs like this: http://my-site.com/address

And I would support * symbol in the URL for users. All attempts to navigate to such address are blocked by ASP.NET with the following error message:

HTTP Error 400.0 - Bad Request ASP.NET detected invalid characters in the URL.

In this case execution doesn t reach to the BeginRequest handler.

Is there any posibility to get ability to process URLs with * symbol (and other reserved too if possible).

Thanks

最佳回答

What is the purpose of having a * in the URL, you may be able to disable some URL filtering setting to allow this but this will impact the security of your site. Take a look at the following if you really need to do this:

http://dirk.net/2008/06/09/ampersand-the-request-url-in-iis7/ http://support.microsoft.com/kb/820129 http://www.lostechies.com/blogs/joshuaflanagan/archive/2009/04/27/asp-net-400-bad-request-with-restricted-characters.aspx

An HttpModule which is properly coded and registered in web.config will automatically receive any request which ASP.Net starts to process, if ASP.Net rejects the request prior to starting processing then the BeginRequest method will never get called.

Depending on what you are trying to do it may be better to create a HttpHandler and register it with a wildcard path instead.

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签