Custom DropDownList
-
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.
-
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.
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.
-
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.
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
-
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
Glad I could be of some help.