Redirecting to another page

Discussion in 'ASP .Net Web Controls' started by KAMAL, Nov 2, 2006.

  1. KAMAL

    KAMAL Guest

    Hi all,
    I have one doubt that how some web sites will rediect from one page
    to another page with out displaying the redirecting pages in the url .

    for example:
    Redirecting from one page to another page we have to use
    http://www.somesite.com/login/register.aspx
    some other sites will use like this
    http://www.somesite.com/login/dsf323assd
    In second one there is no extension to redirect to another page, often it
    redirects .I am just saying the example.
    How the second format is used to redirect from one page to another page is
    it possible in .net 2003. if yes pls help me in doing that.

    Thanks in advance.

    Regards,
    kamal.
     
    KAMAL, Nov 2, 2006
    #1
    1. Advertisements

  2. KAMAL

    6doughnuts Guest

    Not sure exactly what you're asking for here, but basically there are
    two ways to redirect. Response.Redirect() will cause IIS to tell the
    client to go somewhere else (HTTP 30x response). This will terminate
    the current request and prompt the client browser to make a new request
    to the specified URL. The new URL will appear in the browsers Address
    bar.

    The second way is to use Server.Transfer(). This transfers the current
    request to another page or handler, optionally preserving the full
    state of the request. The client will never know this happened, and
    will still see the original URL in the browser. However, the target of
    the transfer must be on the same server.

    As for URLs with no file extension... this can be done by mapping
    HttpHandlers (or HttpModules maybe) to certain paths in a site. The
    extra stuff on the URL can then be parsed out and used like parameters
    by the handler if that's what you want to do.

    Hope this helps,
    Matt
     
    6doughnuts, Nov 3, 2006
    #2
    1. Advertisements

  3. KAMAL

    KAMAL Guest

    Hi Matt,
    Thank u. URL mapping is very is Tom cat. Is it difficult in .net or
    an easy to do it with HttpHandlers.

    Regards,
    Kamal.
     
    KAMAL, Nov 4, 2006
    #3
  4. KAMAL

    6doughnuts Guest

    A basic HttpHandler is pretty easy to implement in .Net, but it must be
    configured in web.config and IIS before it will work (in .Net 1.1,
    anyway). Check out MSDN for details on how to implement it.
     
    6doughnuts, Nov 6, 2006
    #4
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.