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. Custom DropDownList

Custom DropDownList

Scheduled Pinned Locked Moved ASP.NET
csharpjavascriptasp-netdesign
4 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.
  • J Offline
    J Offline
    John Gathogo
    wrote on last edited by
    #1

    I have created a custom DropDownList in an attempt to extend the existing System.Web.UI.DropDownList in ASP.NET. In the implementation I have had to override Render and RenderContents while using some JavaScript to define the control behaviour. Everything is fine about the control and it renders properly on a 'normal' asp page until I take it to a page that uses a masterpage. Then it becomes distorted with the pulldown appearing some distance away from the textarea. Where should I start looking. The control's javascript or the masterpage.

    D 1 Reply Last reply
    0
    • J John Gathogo

      I have created a custom DropDownList in an attempt to extend the existing System.Web.UI.DropDownList in ASP.NET. In the implementation I have had to override Render and RenderContents while using some JavaScript to define the control behaviour. Everything is fine about the control and it renders properly on a 'normal' asp page until I take it to a page that uses a masterpage. Then it becomes distorted with the pulldown appearing some distance away from the textarea. Where should I start looking. The control's javascript or the masterpage.

      D Offline
      D Offline
      doWhileSomething
      wrote on last edited by
      #2

      I'd probably have a look at the source of the page once rendered, typically when using a master page and assumingly Content Place Holder(s), dynamic element ID's have a way of changing. e.g. Your control might have been cmbStates in your (solo) aspx page, but once added to a master page, that very same control might now be ctl100_cmbStates or something similar. So, if you were relying on JS to interact with the controls ID, it might have changed. I would certainly start there first. Also make sure if you are using CSS sheets, that it is properly referenced and defined properly.

      My Personal Site

      J 1 Reply Last reply
      0
      • D doWhileSomething

        I'd probably have a look at the source of the page once rendered, typically when using a master page and assumingly Content Place Holder(s), dynamic element ID's have a way of changing. e.g. Your control might have been cmbStates in your (solo) aspx page, but once added to a master page, that very same control might now be ctl100_cmbStates or something similar. So, if you were relying on JS to interact with the controls ID, it might have changed. I would certainly start there first. Also make sure if you are using CSS sheets, that it is properly referenced and defined properly.

        My Personal Site

        J Offline
        J Offline
        John Gathogo
        wrote on last edited by
        #3

        Thanks alot. I had forgotten that since my masterpage made provision for a content panel and an index panel, I needed to do to some adjustment to the position of the control inorder to position it correctly on the page relative to other controls on the page. Your idea was an eyeopener

        D 1 Reply Last reply
        0
        • J John Gathogo

          Thanks alot. I had forgotten that since my masterpage made provision for a content panel and an index panel, I needed to do to some adjustment to the position of the control inorder to position it correctly on the page relative to other controls on the page. Your idea was an eyeopener

          D Offline
          D Offline
          doWhileSomething
          wrote on last edited by
          #4

          Glad I could be of some help.

          My Personal Site

          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