473,834 Members | 1,801 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Alternatives to Application_Beg inRequest()

Hi guys

I've used an Application_Beg inRequest 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_Beg inRequest?

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_Beg inRequest, 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 2686
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_Beg inRequest()
thread-index: Acg2hucOuQmtoH6 STqWR77GjeWzPuA ==
X-WBNR-Posting-Host: 172.159.105.252
From: =?Utf-8?B?bXVzb3NkZXY =?= <mu*******@comm unity.nospam>
Subject: Alternatives to Application_Beg inRequest()
Date: Tue, 4 Dec 2007 07:04:01 -0800
Lines: 22
Message-ID: <3E************ *************** *******@microso ft.com>
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.publi c.dotnet.framew ork.aspnet
Path: TK2MSFTNGHUB02. phx.gbl
Xref: TK2MSFTNGHUB02. phx.gbl microsoft.publi c.dotnet.framew ork.aspnet:5235 1
NNTP-Posting-Host: tk2msftibfm01.p hx.gbl 10.40.244.149
X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet

Hi guys

I've used an Application_Beg inRequest 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_Beg inRequest?

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_Beg inRequest, to allow me to use url rewriting.

Alternativel y, 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_Pre RequestHandlerE xecute.

It does fire, but when I then use HttpContext.Cur rent.RewritePat h, 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_Beg inRequest()
thread-index: Acg2hucOuQmtoH6 STqWR77GjeWzPuA ==
X-WBNR-Posting-Host: 172.159.105.252
From: =?Utf-8?B?bXVzb3NkZXY =?= <mu*******@comm unity.nospam>
Subject: Alternatives to Application_Beg inRequest()
Date: Tue, 4 Dec 2007 07:04:01 -0800
Lines: 22
Message-ID: <3E************ *************** *******@microso ft.com>
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.publi c.dotnet.framew ork.aspnet
Path: TK2MSFTNGHUB02. phx.gbl
Xref: TK2MSFTNGHUB02. phx.gbl microsoft.publi c.dotnet.framew ork.aspnet:5235 1
NNTP-Posting-Host: tk2msftibfm01.p hx.gbl 10.40.244.149
X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet

Hi guys

I've used an Application_Beg inRequest 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_Beg inRequest?

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_Beg inRequest, 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 "BeginReque st" event is not supported(and you found your
beginrequest code in global.asax not supported), you can ask them whether
it is "BeginReque st" 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*******@comm unity.nospam>
References: <3E************ *************** *******@microso ft.com>
<Rr************ **@TK2MSFTNGHUB 02.phx.gbl>
>Subject: RE: Alternatives to Application_Beg inRequest()
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_Pr eRequestHandler Execute.

It does fire, but when I then use HttpContext.Cur rent.RewritePat h, 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?

Alternativel y, 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_Beg inRequest()
thread-index: Acg2hucOuQmtoH6 STqWR77GjeWzPuA ==
X-WBNR-Posting-Host: 172.159.105.252
From: =?Utf-8?B?bXVzb3NkZXY =?= <mu*******@comm unity.nospam>
Subject: Alternatives to Application_Beg inRequest()
Date: Tue, 4 Dec 2007 07:04:01 -0800
Lines: 22
Message-ID: <3E************ *************** *******@microso ft.com>
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.publi c.dotnet.framew ork.aspnet
Path: TK2MSFTNGHUB02. phx.gbl
Xref: TK2MSFTNGHUB02. phx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:5235 1
>NNTP-Posting-Host: tk2msftibfm01.p hx.gbl 10.40.244.149
X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet

Hi guys

I've used an Application_Beg inRequest 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_Beg inRequest?

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_Beg inRequest, to allow me to use url
rewriting.
>
Alternativel y, 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
18355
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 the code below, I get the following error... "System.NullReferenceException: Object reference not set to an instance of an object" ****************************************** protected void Session_Start(Object sender, EventArgs e) { System.Uri...
3
6023
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 this context 2) How can I get the name of the Page being requested from within Application_BeginRequest ? ((System.Web.UI.Page)HttpContext.Current.Handler).ToString() returns "".
2
5590
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 tried loading the current context using 'Dim context As HttpContext = HttpContext.Current' but get the error 'Object reference not set to an instance of an object' Anyone know how you get at this?
7
5242
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 folder are using this code of url rewrite project is running completely fine on localhost but after uploading first page (http://emailware.net.temporary.domain.name/user/index.aspx) is fine but as i click 123 Easy-CD Ripper
1
2214
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 is my code: protected void Application_BeginRequest(Object sender, EventArgs e) {
0
1091
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 default.aspx. In this aspx file I load the user Control , thats it. But when i start the web site then I see the page execution goes thru easliy , but after load control happens the Application_Beginrequest is called again and again atleast 10 - 15...
0
1434
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 Request. So in my Application_Beginrequest function i am writing a line to the event viewer.I see that for each request my event viewer has 3 entries.
19
3592
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 dynamically, something like: protected void Application_BeginRequest(Object sender, EventArgs e) { if (Session == "True")
7
2577
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 example: If I call www.mysite.com/UserName. I want to rewrite the UserName part. This works fine in my dev environment but when I publish the site Application_BeginRequest does not get called for this URL. It does however get called for any of the...
0
9797
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10547
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10219
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9331
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7757
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6954
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5626
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3977
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.