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. How to Create a Property Which will contain a Dropdown?

How to Create a Property Which will contain a Dropdown?

Scheduled Pinned Locked Moved ASP.NET
questioncsharpdesignhelptutorial
2 Posts 2 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.
  • F Offline
    F Offline
    fasih1981
    wrote on last edited by
    #1

    Dear Concerned, I want to create a property in my user control which i am creating in Web Control Library. I am using .Net 2003. My question is that how I can create a property that will contain a dropdown list & will have five values 1,2,3,4,5. The Programmer will be able to select one of these values at design time in his aspx page. Please help in the form of code. Thanks, Fasih

    fasih_is_my_signature

    S 1 Reply Last reply
    0
    • F fasih1981

      Dear Concerned, I want to create a property in my user control which i am creating in Web Control Library. I am using .Net 2003. My question is that how I can create a property that will contain a dropdown list & will have five values 1,2,3,4,5. The Programmer will be able to select one of these values at design time in his aspx page. Please help in the form of code. Thanks, Fasih

      fasih_is_my_signature

      S Offline
      S Offline
      sam L 0
      wrote on last edited by
      #2

      Not sure what exactly you are looking for, but it sounds like you need to know how to populate a drop down list. ddl.Items.Insert(0, "--Select--"); ddl.Items.Insert(1, "Value 1 or whatever"); This is how you hard code the values to be displayed, if you want to load 'em dynamically, then use a dataset or something as a datasourse for this drop down list. Look at the code below: ddl.DataSource = ds; ddl.DataTextField = "Columns_Name"; ddl.DataValueField = "Column_Name"; // note this won't be diaplayed ddl.DataBind(); *NOTE : ddl = drop down list Hope this helps. sam Eating, drinking and coding...you can't have it better than that!!

      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