Javascript in ASP.NET - Pop another window

Discussion in 'ASP .Net' started by Nevyn Twyll, Jul 31, 2003.

  1. Nevyn Twyll

    Nevyn Twyll Guest

    I've got a web form with a number of dropdowns, combos, etc.
    When the user submits the form, I want to redirect them to another form, but
    I need to pop it in another window. So, I have a hyperlink on the form
    whose NavigateURL gets refreshed whenever the user makes a selection
    (...NavigateUrl = '<%#DataBinder.Eval(Container, "GetRedirect()") %>'...) -
    but it's too slow to do all those round-trips!

    I understand that in the code-behind form, I can Response.Redirect(), but I
    can't do it in a new window (like if you set the <asp:hyperlink
    Target="_blank">).

    So, could someone show me how I could link a button to some Javascript that
    would call code-behind code to get the response string, and run that code in
    a new window?

    Thanks!

     
    Nevyn Twyll, Jul 31, 2003
    #1
    1. Advertising

  2. Nevyn,

    In the code-behind, you could add client side javascript like so:

    ' This is assuming your button name is btnSubmit

    btnSubmit.Attributes.Add("onclick", "window.open(blahblah.aspx);")

    HTH,

    Jeff Cheung

    Nevyn Twyll wrote:

    > I've got a web form with a number of dropdowns, combos, etc.
    > When the user submits the form, I want to redirect them to another form, but
    > I need to pop it in another window. So, I have a hyperlink on the form
    > whose NavigateURL gets refreshed whenever the user makes a selection
    > (...NavigateUrl = '<%#DataBinder.Eval(Container, "GetRedirect()") %>'...) -
    > but it's too slow to do all those round-trips!
    >
    > I understand that in the code-behind form, I can Response.Redirect(), but I
    > can't do it in a new window (like if you set the <asp:hyperlink
    > Target="_blank">).
    >
    > So, could someone show me how I could link a button to some Javascript that
    > would call code-behind code to get the response string, and run that code in
    > a new window?
    >
    > Thanks!
    >
    >
    >
    >
    >
    >
    >
     
    Cheung, Jeffrey Jing-Yen, Jul 31, 2003
    #2
    1. Advertising

  3. Nevyn Twyll

    Nevyn Twyll Guest

    So, I feel a little dumb, but since the Reponse string (blahblah.aspx) is
    dynamically calculated from the selected contents of the form, how do I get
    this info in there so that when the user presses the button, that info is
    calculated correctly?

    Do I put a javascript method in the html? How do I then reference all the
    controls / etc. in my code-behind?

    is there any way the javascript below (where do I put that again) can call a
    code-behind method?

    "Cheung, Jeffrey Jing-Yen" <> wrote in message
    news:...
    > Nevyn,
    >
    > In the code-behind, you could add client side javascript like so:
    >
    > ' This is assuming your button name is btnSubmit
    >
    > btnSubmit.Attributes.Add("onclick", "window.open(blahblah.aspx);")
    >
    > HTH,
    >
    > Jeff Cheung
    >
    > Nevyn Twyll wrote:
    >
    > > I've got a web form with a number of dropdowns, combos, etc.
    > > When the user submits the form, I want to redirect them to another form,

    but
    > > I need to pop it in another window. So, I have a hyperlink on the form
    > > whose NavigateURL gets refreshed whenever the user makes a selection
    > > (...NavigateUrl = '<%#DataBinder.Eval(Container, "GetRedirect()")

    %>'...) -
    > > but it's too slow to do all those round-trips!
    > >
    > > I understand that in the code-behind form, I can Response.Redirect(),

    but I
    > > can't do it in a new window (like if you set the <asp:hyperlink
    > > Target="_blank">).
    > >
    > > So, could someone show me how I could link a button to some Javascript

    that
    > > would call code-behind code to get the response string, and run that

    code in
    > > a new window?
    > >
    > > Thanks!
    > >
    > >
    > >
    > >
    > >
    > >
    > >

    >
     
    Nevyn Twyll, Jul 31, 2003
    #3
  4. Nevyn Twyll

    Saravana Guest

    Check out this article,
    http://www.microsoft.com/india/msdn/articles/PopupCalendarinASP.aspx

    --
    Saravana
    Microsoft India Community Star,MC**
    www.ExtremeExperts.com



    "Nevyn Twyll" <> wrote in message
    news:#...
    > So, I feel a little dumb, but since the Reponse string (blahblah.aspx) is
    > dynamically calculated from the selected contents of the form, how do I

    get
    > this info in there so that when the user presses the button, that info is
    > calculated correctly?
    >
    > Do I put a javascript method in the html? How do I then reference all the
    > controls / etc. in my code-behind?
    >
    > is there any way the javascript below (where do I put that again) can call

    a
    > code-behind method?
    >
    > "Cheung, Jeffrey Jing-Yen" <> wrote in

    message
    > news:...
    > > Nevyn,
    > >
    > > In the code-behind, you could add client side javascript like so:
    > >
    > > ' This is assuming your button name is btnSubmit
    > >
    > > btnSubmit.Attributes.Add("onclick", "window.open(blahblah.aspx);")
    > >
    > > HTH,
    > >
    > > Jeff Cheung
    > >
    > > Nevyn Twyll wrote:
    > >
    > > > I've got a web form with a number of dropdowns, combos, etc.
    > > > When the user submits the form, I want to redirect them to another

    form,
    > but
    > > > I need to pop it in another window. So, I have a hyperlink on the

    form
    > > > whose NavigateURL gets refreshed whenever the user makes a selection
    > > > (...NavigateUrl = '<%#DataBinder.Eval(Container, "GetRedirect()")

    > %>'...) -
    > > > but it's too slow to do all those round-trips!
    > > >
    > > > I understand that in the code-behind form, I can Response.Redirect(),

    > but I
    > > > can't do it in a new window (like if you set the <asp:hyperlink
    > > > Target="_blank">).
    > > >
    > > > So, could someone show me how I could link a button to some Javascript

    > that
    > > > would call code-behind code to get the response string, and run that

    > code in
    > > > a new window?
    > > >
    > > > Thanks!
    > > >
    > > >
    > > >
    > > >
    > > >
    > > >
    > > >

    > >

    >
    >
     
    Saravana, Aug 1, 2003
    #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. Shiperton Henethe
    Replies:
    17
    Views:
    5,495
    Deirdre Saoirse Moen
    May 21, 2004
  2. J P Singh
    Replies:
    3
    Views:
    379
    Howard Rothenburg
    Feb 11, 2004
  3. Madame Blablavatsky
    Replies:
    8
    Views:
    207
    Dr John Stockton
    Sep 16, 2005
  4. carrajo
    Replies:
    2
    Views:
    142
    scripts.contact
    May 21, 2007
  5. Jimmy
    Replies:
    3
    Views:
    185
    David Mark
    Oct 7, 2007
Loading...

Share This Page