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. Usercontrol in Asp.net with C#

Usercontrol in Asp.net with C#

Scheduled Pinned Locked Moved ASP.NET
csharpquestionasp-net
5 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
    mahichandu
    wrote on last edited by
    #1

    Hi I created one user control for list of years to populate in dropdownlist.. i want to use same usercontrol in pageload for two dropdown list controls(i mean i want to populate listofyears in two dropdownlists).. I can't make same ID for two dropdownlist na..How can i call my usercontrol to two dropdowncontrols in same page??? can anyoneexplain in detail...Thanx in advance

    N 1 Reply Last reply
    0
    • M mahichandu

      Hi I created one user control for list of years to populate in dropdownlist.. i want to use same usercontrol in pageload for two dropdown list controls(i mean i want to populate listofyears in two dropdownlists).. I can't make same ID for two dropdownlist na..How can i call my usercontrol to two dropdowncontrols in same page??? can anyoneexplain in detail...Thanx in advance

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      First if all the UserControl contains in a dropdownlist then it is overkill, just create two dropdowns on your page and populate them from the same datasource.


      only two letters away from being an asset

      C 1 Reply Last reply
      0
      • N Not Active

        First if all the UserControl contains in a dropdownlist then it is overkill, just create two dropdowns on your page and populate them from the same datasource.


        only two letters away from being an asset

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        Well, if you use the same datasource, they will sync up, you need to clone the datasource for the second contrll, don't you ?

        Christian Graus Driven to the arms of OSX by Vista. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums. I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp

        N 1 Reply Last reply
        0
        • C Christian Graus

          Well, if you use the same datasource, they will sync up, you need to clone the datasource for the second contrll, don't you ?

          Christian Graus Driven to the arms of OSX by Vista. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums. I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp

          N Offline
          N Offline
          Not Active
          wrote on last edited by
          #4

          Perhaps I'm missing something, or misinterpreting, the original and your post. List years = .... DropDown1.DataSource = years DropDown2.DataSource = years


          only two letters away from being an asset

          C 1 Reply Last reply
          0
          • N Not Active

            Perhaps I'm missing something, or misinterpreting, the original and your post. List years = .... DropDown1.DataSource = years DropDown2.DataSource = years


            only two letters away from being an asset

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #5

            Maybe it's only in winforms that that won't work. Actually, I think it is only winforms.

            Christian Graus Driven to the arms of OSX by Vista. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums. I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp

            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