[HELP] Global.asax doen't execute OnBeginRequest

F

Fransis il Mulo

Yesterday I posted about Url-Rewriting. Now I have solved this kind of
problem but now I have troubles deploying on Win2003 my application.

I develop apps on VS 2005 and XP pro. To manage Url-Rewriting i insert
code in the OnBeginRequest method in Global.asax. It works fine on dev
machine but when I deploy on Win 2003 Server it doesn't work.

Everytime my app fire the OnBeginRequest I also write a log row in a
text file with requested Url. On Dev machine if I call test.aspx in log
file i find many rows one for each file enclosed in web page (the page
itself, css, images ...).

On Win 2003 server in log file I find only one row , the page itself.
No errors but also no url-rewritig.

Can you help me?

Thanks a lot.

Fransis
 
F

Fransis il Mulo

I try to explain better:

I inserted this code in OnBeginRequest.


if (!System.IO.File.Exists(Request.PhysicalPath))
{
Context.RewritePath("~/test.aspx", false);
}


Then on a web page (default.aspx) i've a link to url "NotExistingFile.html".

When I enter the default.aspx the code inside OnBeginRequest is
executed. Instead, When I clik the link to NotExistingFile.html the code
is not executed.

This code works right on dev machine with (VS2005 and XP Pro) but not on
Win 2003 Server.

Can you help me?

Thanks

Fransis
 
D

David

If you change the link to NotExistingFile.aspx, then I would guess that it
works.

Basically, if you are trying to redirect a file that doesn't exist, then you
have to ensure that the (non-existant) file you are linking to is being
handled by .NET. In this case, .HTML is probably not being checked.

So, basically, if you want .html to be used by .NET, then you have to set
your mappings in IIS to cause .html to be handled.

--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
 
F

Fransis il Mulo

David ha scritto:
If you change the link to NotExistingFile.aspx, then I would guess that it
works.

Basically, if you are trying to redirect a file that doesn't exist, then you
have to ensure that the (non-existant) file you are linking to is being
handled by .NET. In this case, .HTML is probably not being checked.

So, basically, if you want .html to be used by .NET, then you have to set
your mappings in IIS to cause .html to be handled.

Perfect, now it works!

Thanks a lot
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,817
Latest member
AdalbertoT

Latest Threads

Top