473,412 Members | 3,015 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

Alternatives to Application_BeginRequest()

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
Dec 4 '07 #1
3 2650
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/archi...l-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=?= <mu*******@community.nospam>
Subject: Alternatives to Application_BeginRequest()
Date: Tue, 4 Dec 2007 07:04:01 -0800
Lines: 22
Message-ID: <3E**********************************@microsoft.co m>
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.

Dec 4 '07 #2
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,

"Nanda Lella[MSFT]" wrote:
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/archi...l-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=?= <mu*******@community.nospam>
Subject: Alternatives to Application_BeginRequest()
Date: Tue, 4 Dec 2007 07:04:01 -0800
Lines: 22
Message-ID: <3E**********************************@microsoft.co m>
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.

Dec 5 '07 #3
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=?= <mu*******@community.nospam>
References: <3E**********************************@microsoft.co m>
<Rr**************@TK2MSFTNGHUB02.phx.gbl>
>Subject: RE: Alternatives to Application_BeginRequest()
Date: Wed, 5 Dec 2007 05:15:00 -0800
>
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,

"Nanda Lella[MSFT]" wrote:
>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/archi...l-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=?= <mu*******@community.nospam>
Subject: Alternatives to Application_BeginRequest()
Date: Tue, 4 Dec 2007 07:04:01 -0800
Lines: 22
Message-ID: <3E**********************************@microsoft.co m>
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.
>>
Dec 6 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Paul Daly (MCP) | last post by:
I'm trying to write a log file that captures the referring url if the request is a new session, and captures a querystring value if the user is browsing between pages on the website. When using...
3
by: JezB | last post by:
1) How can I access my object-oreinted classes from the global.asax Application_BeginRequest event ? I cannot instantiate them from session since it complains : Session state is not available in...
2
by: Stu | last post by:
Hi, I am trying to access session variable value from the 'Application_BeginRequest' handler in the global asax file but get the message - 'Session state not available in this context'. I have...
7
by: Ankit Aneja | last post by:
I put the code for url rewrite in my Application_BeginRequest on global.ascx some .aspx pages are in root ,some in folder named admin and some in folder named user aspx pages which are in user...
1
by: tao lin | last post by:
Hi, all I am using VS 2005 under windows 2000. I just upgrade my asp.net app from 1.1 to 2.0. And I found a very strange proglem in my Global.asax.cs's Application_BeginRequest function, here...
0
by: Rahul | last post by:
I am using Application_BeginRequest function in my Global.ascx file and I have a breakpoint set over there. I have a master page and and one of the content of the master page pints to...
0
by: Rahul | last post by:
Earlier this evening i posted a question that my debug point is hit several times, But after I published the application. I could significantly see less round trip per request for Application_Begin...
19
by: Mark Rae | last post by:
Hi, Is it possible to have programmatic access to the Page object in Application_BeginRequest, or is it too early in the lifecycle...? E.g. to be able to change a page's MasterPage...
7
by: Joe | last post by:
I'm trying to use the Application_BeginRequest to re-write the path but it doesn't work on the published site when a non-existing URL is called. This does work fine in my dev environment. For...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.