View Single Post
  #1 (permalink)  
Old December 19th, 2006, 12:52 PM
yasminnnnn yasminnnnn is offline
Authorized User
 
Join Date: Nov 2006
Location: , , .
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to yasminnnnn
Default preselecting dropdownlist item

hey
i have a detailsview and a seperate dropdownlist in my page. i get a variable MTDescription via querystring from another page. i try to find that text value in the dropdownlist items and i want it to be returned as selected item.dropdownlist gets its values from a sql datasource..
this is what i tried:
            Label11.Text = Request.QueryString["MTDescription"];
            DropDownList1.SelectedIndex = DropDownList1.Items.IndexOf(DropDownList1.Items.Fi ndByText(Label11.Text));


when i write it to button_click event, it works fine however i want it to happen when the page loads or something else than clicking a button..i tried many events but they dont work:(

what can i do?
many thanks..