redirect from javascript

Discussion in 'ASP .Net' started by Mike P, Oct 15, 2007.

  1. Mike P

    Mike P Guest

    Is it possible to do a redirect from Javascript, and pass to it a value
    that is in your server side code, such as a ViewState value?



    *** Sent via Developersdex http://www.developersdex.com ***
     
    Mike P, Oct 15, 2007
    #1
    1. Advertising

  2. Mike P

    Patrice Guest

    "redirect" is generally used server side.

    document.location.href allows to point the browser to another URL. Or you
    could change the action property to submit data on another page ? Or it
    could be an AJAX call etc...

    You may want to explain what you are trying do (I mean the functionality you
    are trying to implement rather than how to implement the solution you seems
    to have in mind for your problem).

    This way one could suggest a possibly better approach or we'll better
    understand what is this "redirect" you are talking about....

    "Mike P" <> a écrit dans le message de news:
    ...
    > Is it possible to do a redirect from Javascript, and pass to it a value
    > that is in your server side code, such as a ViewState value?
    >
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
     
    Patrice, Oct 15, 2007
    #2
    1. Advertising

  3. On Oct 15, 1:57 pm, Mike P <> wrote:
    > Is it possible to do a redirect from Javascript, and pass to it a value
    > that is in your server side code, such as a ViewState value?


    js-redirect can be done using location.href:

    window.location.href=page.aspx?id=123

    and you can take the value in ASP.NET using Request.QueryString
     
    Alexey Smirnov, Oct 15, 2007
    #3
    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. dh
    Replies:
    2
    Views:
    544
  2. =?Utf-8?B?VHJveQ==?=

    Response.redirect does not redirect from .aspx page

    =?Utf-8?B?VHJveQ==?=, Oct 18, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    5,301
    Srowe1975
    Oct 15, 2008
  3. Replies:
    7
    Views:
    13,239
    justingrant
    Oct 18, 2008
  4. Sal
    Replies:
    1
    Views:
    812
  5. Ron Howard
    Replies:
    2
    Views:
    544
    Ron Howard
    Aug 11, 2004
Loading...

Share This Page