Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / December 2007

Tip: Looking for answers? Try searching our database.

Alternatives to Application_BeginRequest()

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
musosdev - 04 Dec 2007 15:04 GMT
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
Nanda Lella[MSFT] - 04 Dec 2007 21:19 GMT
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==
[quoted text clipped - 39 lines]
>
>Dan

Signature

Thank You,
Nanda Lella,

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

musosdev - 05 Dec 2007 13:15 GMT
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,

> There are several ways you can use to acheive URL rewritting without using
> the Global methods.
[quoted text clipped - 50 lines]
> >
> >Dan
Steven Cheng[MSFT] - 06 Dec 2007 02:57 GMT
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=?= <musoswire@community.nospam>
>References:  <3E14ADFE-C0FD-4BB1-A870-90D1C161E652@microsoft.com>
<Rri1ftrNIHA.4200@TK2MSFTNGHUB02.phx.gbl>
>Subject: RE: Alternatives to Application_BeginRequest()
>Date: Wed, 5 Dec 2007 05:15:00 -0800

>Hi
>
[quoted text clipped - 18 lines]
>> 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
>>
[quoted text clipped - 46 lines]
>> >
>> >Dan

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.