How to append DropDownList value to button's PostBackUrl?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • rob

    How to append DropDownList value to button's PostBackUrl?

    Hi,

    I have a button whose PostBackUrl should include a value from a dropdownlist
    on the same page. Should I do that in the button's on click event? What
    I'd like to end up with is a post back url that looks like the following:
    PostBackUrl=som epage.aspx?para m=<valuewhere <valuecomes from the
    currently selected item in the list.

    Thanks,
    Rob


  • Teemu Keiski

    #2
    Re: How to append DropDownList value to button's PostBackUrl?

    Hi,

    this does not reply 100% exactly what you asked for but in my post

    ASP.NET: trigger cross-page postback on ListBox selection change


    I demonstrate how to use PostBackUrl type of stuff (=cross-page postback)
    so that the value is accessible via PreviousPage

    --
    Teemu Keiski
    AspInsider, ASP.NET MVP





    "rob" <r@c.comwrote in message
    news:%238gutmqi IHA.5968@TK2MSF TNGP04.phx.gbl. ..
    Hi,
    >
    I have a button whose PostBackUrl should include a value from a
    dropdownlist on the same page. Should I do that in the button's on click
    event? What I'd like to end up with is a post back url that looks like
    the following:
    PostBackUrl=som epage.aspx?para m=<valuewhere <valuecomes from the
    currently selected item in the list.
    >
    Thanks,
    Rob
    >

    Comment

    • Teemu Keiski

      #3
      Re: How to append DropDownList value to button's PostBackUrl?

      Forgot to say, it should also work for DropDownList just as well as for
      ListBox.


      --
      Teemu Keiski
      AspInsider, ASP.NET MVP




      "Teemu Keiski" <joteke@aspalli ance.comwrote in message
      news:Orq66UsiIH A.6032@TK2MSFTN GP03.phx.gbl...
      Hi,
      >
      this does not reply 100% exactly what you asked for but in my post
      >
      ASP.NET: trigger cross-page postback on ListBox selection change

      >
      I demonstrate how to use PostBackUrl type of stuff (=cross-page postback)
      so that the value is accessible via PreviousPage
      >
      --
      Teemu Keiski
      AspInsider, ASP.NET MVP


      >
      >
      >
      "rob" <r@c.comwrote in message
      news:%238gutmqi IHA.5968@TK2MSF TNGP04.phx.gbl. ..
      >Hi,
      >>
      >I have a button whose PostBackUrl should include a value from a
      >dropdownlist on the same page. Should I do that in the button's on click
      >event? What I'd like to end up with is a post back url that looks like
      >the following:
      >PostBackUrl=so mepage.aspx?par am=<valuewhere <valuecomes from the
      >currently selected item in the list.
      >>
      >Thanks,
      >Rob
      >>
      >
      >

      Comment

      Working...