Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Dropdownlist

Dropdownlist

Scheduled Pinned Locked Moved ASP.NET
6 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    isaii
    wrote on last edited by
    #1

    Hello, I have webpage1 that has a dropdown list contains Department list. When I click submit, in my second webpage, the dropdownlist must contain the names of the Department selected in the webpage1. Anybody can show me the simple code for this one. Thanks in advance.

    _ G 2 Replies Last reply
    0
    • I isaii

      Hello, I have webpage1 that has a dropdown list contains Department list. When I click submit, in my second webpage, the dropdownlist must contain the names of the Department selected in the webpage1. Anybody can show me the simple code for this one. Thanks in advance.

      _ Offline
      _ Offline
      _AK_
      wrote on last edited by
      #2

      You can send the selected item value to the second page through querystring and then can access that in second page and set the selected item.

      Best Regards, Apurva Kaushal

      1 Reply Last reply
      0
      • I isaii

        Hello, I have webpage1 that has a dropdown list contains Department list. When I click submit, in my second webpage, the dropdownlist must contain the names of the Department selected in the webpage1. Anybody can show me the simple code for this one. Thanks in advance.

        G Offline
        G Offline
        gus_br
        wrote on last edited by
        #3

        Or... you can configure the PostBackUrl property of a ASP.NET Link Button. Then, within the other page code, you can access Page.PreviousPage. It'll give you access to the members of the previous page (the one that contains the link button), like the selected Item you want. I think this aproach is even better because it keeps your URL clean. :]

        I S 2 Replies Last reply
        0
        • G gus_br

          Or... you can configure the PostBackUrl property of a ASP.NET Link Button. Then, within the other page code, you can access Page.PreviousPage. It'll give you access to the members of the previous page (the one that contains the link button), like the selected Item you want. I think this aproach is even better because it keeps your URL clean. :]

          I Offline
          I Offline
          isaii
          wrote on last edited by
          #4

          hi... thank you so much. I really appreciate if you can show me some code for this. Thanks in advance.

          V 1 Reply Last reply
          0
          • I isaii

            hi... thank you so much. I really appreciate if you can show me some code for this. Thanks in advance.

            V Offline
            V Offline
            varshavmane
            wrote on last edited by
            #5

            try this: On page1 u send it as: Response.Redirect("frmUserMaster.aspx?id=" & cmbName.Items(cmbName.SelectedIndex).Value) on 2nd page u can get this value as: NameID = Request.Params("id") Hope this helps u..

            1 Reply Last reply
            0
            • G gus_br

              Or... you can configure the PostBackUrl property of a ASP.NET Link Button. Then, within the other page code, you can access Page.PreviousPage. It'll give you access to the members of the previous page (the one that contains the link button), like the selected Item you want. I think this aproach is even better because it keeps your URL clean. :]

              S Offline
              S Offline
              Sandeep Akhare
              wrote on last edited by
              #6

              But it depends on the version .i.e Available in ASP.NET 2.0 only

              Thanks and Regards Sandeep If you want something you never had, do something you have never done!

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups