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. General Programming
  3. C#
  4. Simple Problem but tough for me

Simple Problem but tough for me

Scheduled Pinned Locked Moved C#
helpcsharp
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.
  • L Offline
    L Offline
    lalit14
    wrote on last edited by
    #1

    Hello... I m creating ASP Website in C#. There is one drop down list and one text box In drop down list, i have country's name. Problem: i just want is that textbox will display the selected item in drop down list. Suppose if i select INDIA in Drop down list then textbox must display INDIA.. Please Help me out. Thanks in Advance. Lalit

    L 1 Reply Last reply
    0
    • L lalit14

      Hello... I m creating ASP Website in C#. There is one drop down list and one text box In drop down list, i have country's name. Problem: i just want is that textbox will display the selected item in drop down list. Suppose if i select INDIA in Drop down list then textbox must display INDIA.. Please Help me out. Thanks in Advance. Lalit

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      In C# WinForm use the event SelectedIndexChanged from ComboBox :

      private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
      {
      textBox1.Text = comboBox1.Text;
      }

      But in ASP, ask in ASP.NET forum.

      L 1 Reply Last reply
      0
      • L Lost User

        In C# WinForm use the event SelectedIndexChanged from ComboBox :

        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
        textBox1.Text = comboBox1.Text;
        }

        But in ASP, ask in ASP.NET forum.

        L Offline
        L Offline
        lalit14
        wrote on last edited by
        #3

        I wrote this below code but nothing is working. protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { TextBox1.Text = DropDownList1.Text; }

        L OriginalGriffO 2 Replies Last reply
        0
        • L lalit14

          I wrote this below code but nothing is working. protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { TextBox1.Text = DropDownList1.Text; }

          L Offline
          L Offline
          lalit14
          wrote on last edited by
          #4

          above code i hav written in default.aspx.cs file

          L 1 Reply Last reply
          0
          • L lalit14

            above code i hav written in default.aspx.cs file

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            Have you ever used event handler ?? Do this first ... comboBox1.SelectedIndexChanged += comboBox1_SelectedIndexChanged;

            L 1 Reply Last reply
            0
            • L lalit14

              I wrote this below code but nothing is working. protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { TextBox1.Text = DropDownList1.Text; }

              OriginalGriffO Offline
              OriginalGriffO Offline
              OriginalGriff
              wrote on last edited by
              #6

              Yes, but did you hook into the event? Or just write the handler?

              No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones

              "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
              "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

              1 Reply Last reply
              0
              • L Lost User

                Have you ever used event handler ?? Do this first ... comboBox1.SelectedIndexChanged += comboBox1_SelectedIndexChanged;

                L Offline
                L Offline
                lalit14
                wrote on last edited by
                #7

                Hey thanks ........... I solved my problem. Nice site, and nice members too. Once again Thanks

                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