Alternatives to Application_BeginRequest()

Discussion in 'ASP .Net' started by musosdev, Dec 4, 2007.

  1. musosdev

    musosdev Guest

    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
     
    musosdev, Dec 4, 2007
    #1
    1. Advertising

  2. 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=?= <>
    >Subject: Alternatives to Application_BeginRequest()
    >Date: Tue, 4 Dec 2007 07:04:01 -0800
    >Lines: 22
    >Message-ID: <>
    >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.
     
    Nanda Lella[MSFT], Dec 4, 2007
    #2
    1. Advertising

  3. musosdev

    musosdev Guest

    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/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=?= <>
    > >Subject: Alternatives to Application_BeginRequest()
    > >Date: Tue, 4 Dec 2007 07:04:01 -0800
    > >Lines: 22
    > >Message-ID: <>
    > >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.
    >
    >
     
    musosdev, Dec 5, 2007
    #3
  4. 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=?= <>
    >References: <>

    <>
    >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/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=?= <>
    >> >Subject: Alternatives to Application_BeginRequest()
    >> >Date: Tue, 4 Dec 2007 07:04:01 -0800
    >> >Lines: 22
    >> >Message-ID: <>
    >> >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.
    >>
    >>

    >
     
    Steven Cheng[MSFT], Dec 6, 2007
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Cynic07
    Replies:
    1
    Views:
    485
    Cynic07
    Jul 31, 2003
  2. Amil
    Replies:
    1
    Views:
    487
    William F. Robertson, Jr.
    Feb 19, 2004
  3. =?Utf-8?B?UGF1bCBEYWx5IChNQ1Ap?=

    Session Start / Application_BeginRequest Issues

    =?Utf-8?B?UGF1bCBEYWx5IChNQ1Ap?=, Jul 4, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    6,903
    Craig Deelsnyder
    Jul 4, 2004
  4. JezB
    Replies:
    3
    Views:
    5,512
  5. Stu
    Replies:
    2
    Views:
    9,358
Loading...

Share This Page