Alternatives to Application_BeginRequest()

M

musosdev

Hi guys

I've used an Application_BeginRequest function in my global.asax page to
implement some URL rewriting functionality on our website.

However, upon moving it to my host (1&1.co.uk), it no longer works. They
don't support Application_BeginRequest?

They've given me a list of the low-level functions they do support, which
can be viewed at http://s221042302.websitehome.co.uk/check.aspx

Could someone give me an idea as to whether any of those functions will do a
similar job to Application_BeginRequest, to allow me to use url rewriting.

Alternatively, can someone provide a method to do the rewrites in C#? I need
to be able to access my sql server for the rewrite.

Thanks,



Dan
 
N

Nanda Lella[MSFT]

There are several ways you can use to acheive URL rewritting without using
the Global methods.
For a detailed explanation of the possible approaches try ScottGu's blog at
http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-wi
th-asp-net.aspx

Hope this helps.

--------------------
Thread-Topic: Alternatives to Application_BeginRequest()
thread-index: Acg2hucOuQmtoH6STqWR77GjeWzPuA==
X-WBNR-Posting-Host: 172.159.105.252
From: =?Utf-8?B?bXVzb3NkZXY=?= <[email protected]>
Subject: Alternatives to Application_BeginRequest()
Date: Tue, 4 Dec 2007 07:04:01 -0800
Lines: 22
Message-ID: <[email protected]>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.2992
Newsgroups: microsoft.public.dotnet.framework.aspnet
Path: TK2MSFTNGHUB02.phx.gbl
Xref: TK2MSFTNGHUB02.phx.gbl microsoft.public.dotnet.framework.aspnet:52351
NNTP-Posting-Host: tk2msftibfm01.phx.gbl 10.40.244.149
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet

Hi guys

I've used an Application_BeginRequest function in my global.asax page to
implement some URL rewriting functionality on our website.

However, upon moving it to my host (1&1.co.uk), it no longer works. They
don't support Application_BeginRequest?

They've given me a list of the low-level functions they do support, which
can be viewed at http://s221042302.websitehome.co.uk/check.aspx

Could someone give me an idea as to whether any of those functions will do
a
similar job to Application_BeginRequest, to allow me to use url rewriting.

Alternatively, can someone provide a method to do the rewrites in C#? I need
to be able to access my sql server for the rewrite.

Thanks,



Dan

--

Thank You,
Nanda Lella,

This Posting is provided "AS IS" with no warranties, and confers no rights.
 
M

musosdev

Hi

Thanks for the info. I've read Scott's post before - that is in fact how I
came to use BeginRequest :)

I've just tried switching the code to run in the
Application_PreRequestHandlerExecute.

It does fire, but when I then use HttpContext.Current.RewritePath, it
doesn't seem to send it through the asp.net engine, and I end up with all my
page code displayed in my browser.

Is it possible to fix this? if so, how?

Alternatively, what function from the list I gave can I use that will allow
me to use RewritePath as I am currently doing in my BeginRequest() handler?!

Thanks,
 
S

Steven Cheng[MSFT]

Hi Dan,

As for the web host, I suggest you confirm the following things with them:

** As they said "BeginRequest" event is not supported(and you found your
beginrequest code in global.asax not supported), you can ask them whether
it is "BeginRequest" not supported or any global events in Global.asax that
is not supported?

For BeginRequest, you can also writer a custom httpmodule, you can try it:

#How To Create an ASP.NET HTTP Module Using Visual C# .NET
http://support.microsoft.com/kb/307996/EN-US/

BTW, for the following page, I've checked it. It seems it is a simple
ASP.NET trace page and I can only find some page level events there, are
these page events the ones that web host support? Page events won't help
much for URL Rewriting:

http://s221042302.websitehome.co.uk/check.aspx

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
From: =?Utf-8?B?bXVzb3NkZXY=?= <[email protected]>
References: <[email protected]>
Subject: RE: Alternatives to Application_BeginRequest()
Date: Wed, 5 Dec 2007 05:15:00 -0800
 

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,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top