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 Problem

Dropdownlist Problem

Scheduled Pinned Locked Moved ASP.NET
helptutorialquestion
7 Posts 3 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.
  • M Offline
    M Offline
    monika_vasvani
    wrote on last edited by
    #1

    Hi All I have two dropdownlist.first is ddl_category and second is ddl_op when i select value from ddl_category i want to set this value into ddl_op. declare str str=ddl_Category.Selectedvalue.text I write ddl_op.selectedItem.Text=str But it's not working.I am not getting exact problem.What happened in this situation?Can u help me how to write and assign value in dropdownlist in aspx page? Thanks monika

    A 1 Reply Last reply
    0
    • M monika_vasvani

      Hi All I have two dropdownlist.first is ddl_category and second is ddl_op when i select value from ddl_category i want to set this value into ddl_op. declare str str=ddl_Category.Selectedvalue.text I write ddl_op.selectedItem.Text=str But it's not working.I am not getting exact problem.What happened in this situation?Can u help me how to write and assign value in dropdownlist in aspx page? Thanks monika

      A Offline
      A Offline
      Amit Kushwaha
      wrote on last edited by
      #2

      hi, Set autopostback = true for the first dropdownlist...

      Thanks & Regards... Amit

      M 1 Reply Last reply
      0
      • A Amit Kushwaha

        hi, Set autopostback = true for the first dropdownlist...

        Thanks & Regards... Amit

        M Offline
        M Offline
        monika_vasvani
        wrote on last edited by
        #3

        Hi amit But my both dropdownlist are filled using javascript codeing.So it's not possible to set autopostback property to true. if u have solution pls reply me. Thanks monika

        _ A 2 Replies Last reply
        0
        • M monika_vasvani

          Hi amit But my both dropdownlist are filled using javascript codeing.So it's not possible to set autopostback property to true. if u have solution pls reply me. Thanks monika

          A Offline
          A Offline
          Amit Kushwaha
          wrote on last edited by
          #4

          Hi Monika, create a function in jscript to set the text of 2nd ddl and call this function on 1st ddl's indexchanged event at client side.

          Thanks & Regards... Amit

          M 1 Reply Last reply
          0
          • M monika_vasvani

            Hi amit But my both dropdownlist are filled using javascript codeing.So it's not possible to set autopostback property to true. if u have solution pls reply me. Thanks monika

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

            Does both of your dropdownlists consists of same items and on selection change of the first dropdownlist you want to set the same for the second one?

            Best Regards, Apurva Kaushal

            1 Reply Last reply
            0
            • A Amit Kushwaha

              Hi Monika, create a function in jscript to set the text of 2nd ddl and call this function on 1st ddl's indexchanged event at client side.

              Thanks & Regards... Amit

              M Offline
              M Offline
              monika_vasvani
              wrote on last edited by
              #6

              Hi amit I got my solution thanks. I have one confusion if u have solution pls reply me. I have one function in javascript.This function returns value. How to use this return value in aspx page? function call() { retrun val; } How to use this value in my aspx page? I call javascript function like:ddl_category,attributes.add("onchange","call();") I want a value from function in my aspx page. Pls help me Thanks monika

              A 1 Reply Last reply
              0
              • M monika_vasvani

                Hi amit I got my solution thanks. I have one confusion if u have solution pls reply me. I have one function in javascript.This function returns value. How to use this return value in aspx page? function call() { retrun val; } How to use this value in my aspx page? I call javascript function like:ddl_category,attributes.add("onchange","call();") I want a value from function in my aspx page. Pls help me Thanks monika

                A Offline
                A Offline
                Amit Kushwaha
                wrote on last edited by
                #7

                Hi Monika, in jscript function, u can store ur data in a label or hidden fields, which can be further access from code behind at the server...

                Thanks & Regards... Amit

                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