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. Combo box Event catching

Combo box Event catching

Scheduled Pinned Locked Moved ASP.NET
help
3 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.
  • A Offline
    A Offline
    alok_2k3
    wrote on last edited by
    #1

    Hi, I have a ascx page ItemEdit.ascx. It contains a combobox. This control dynamically added to a aspx page. Now the problem is that i am unable to catch the event(selectedindexchange)of combobox in ItemEdit.ascx control. How will i overcome this problem. plz help me this is very urgent. Thanks n Regards, Alok....

    G A 2 Replies Last reply
    0
    • A alok_2k3

      Hi, I have a ascx page ItemEdit.ascx. It contains a combobox. This control dynamically added to a aspx page. Now the problem is that i am unable to catch the event(selectedindexchange)of combobox in ItemEdit.ascx control. How will i overcome this problem. plz help me this is very urgent. Thanks n Regards, Alok....

      G Offline
      G Offline
      guroo13
      wrote on last edited by
      #2

      If you want to catch the event inside the user control itself, that will not be a problem. For that you can double click on the combobox while in design mode and enviorment will auto generate the handler for the SelectedIndexChanged event by default in side the code behind for .ascx file. But don't forget to set the "AutoPostBack" property of the dropdownbox to true. If you want to handle SelectedIndexChanted even inside your page where you are using this user control then the quickest souloution is as follows: Create a public property in your user control like: public DropDownList List { return ddlYourTargetComboBox; } on your page do something like: ucYourUserControlInstance.List.SelectedIndexChanged += new EventHandler(list_SelectedIndexChanged); void list_SelectedIndexChanged(object sender, EventArgs e) { //Implement logic here } Hope this helps

      1 Reply Last reply
      0
      • A alok_2k3

        Hi, I have a ascx page ItemEdit.ascx. It contains a combobox. This control dynamically added to a aspx page. Now the problem is that i am unable to catch the event(selectedindexchange)of combobox in ItemEdit.ascx control. How will i overcome this problem. plz help me this is very urgent. Thanks n Regards, Alok....

        A Offline
        A Offline
        Arun Immanuel
        wrote on last edited by
        #3

        And also add AutoPostBack Property = true along with the above code.

        Regards, Arun Kumar.A

        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