[2005] Working with User Controls
Plz, i created a user control with three dropdownlist controls and a button. The user will select a combinations of options from these three dropdownlist control. The problem now is that:no matter the user's selection,when i try retrieving the selectedIndex of each of the three dropdownlist controls,it returns the first item on each of them:confused:
Re: [2005] Working with User Controls
Are you setting its AutoPostBack to True?
Could you please show us your code?
Re: [2005] Working with User Controls
Quote:
Originally Posted by Harsh Gupta
Are you setting its AutoPostBack to True?
Could you please show us your code?
The AutoPostBack property for the dropdownlists are set to false,the user will only need to select his choice and the button on the user control will do the postBack( i will retrieve the selectedIndex of the dropdownlists in the button's click event)
Re: [2005] Working with User Controls
Have you done a Page.IsPostBack check to make sure that the control only populates the first time the page is loaded and not on subsequent postbacks?
Re: [2005] Working with User Controls
Quote:
Originally Posted by mendhak
Have you done a Page.IsPostBack check to make sure that the control only populates the first time the page is loaded and not on subsequent postbacks?
Plz,dont mind me,u got it right!.The first implmentation of the user control worked well but had its dropdownlist controls' autoPostback property set to True(also i was reloading the list based on some specific options).I later made some changes to prevent the the dropdownlist from posting back to the server (and loading all possible items on page_Load event) but 4got to coment out the reloading of the dropdownlist items. I was in a rush but thanx 4 ur corrections.Plz let me get back to my work;)
Re: [2005] Working with User Controls
plz,sorry, i 4got 2 ask, after placing the user control on my page, i want some kind of properties other "standard" asp.net controls have. properties such as tabIndex,toolTip, height etc for the user control. I guess i hav 2 inherit from the base clase (userControl?:blush: )