bound dropdowns not filled by page_loadcomplete

V

Victoria Bolton

Using Asp.net 2.0 and Visual Web Developer.

I have an insert form that I want to double up as a edit form. I pass an id
number by querystring and then in the page_Loadcomplete I call a function
that fills the controls on the page with the data from a datareader.

Some of those controls are bound dropdownlists that have usernames, catagory
types and vendor names in etc. In my fill event I am trying this:

Me.ddlCat.SelectedIndex =
ddlCat.Items.IndexOf(ddlCat.Items.FindByText(Trim(rdr("CatName"))))

to select the correct item from the list. However it is not working. When I
break on my sub and check the ddlcat.items.count in the watch window it is
0. So I can only assume the page isn't loading the dropdowns by the time my
sub gets called. The dropdowns are bound using the wizards in design view of
the ASPX page.

I moved this function call from page load to page load complete in hopes of
fixing it but that didn't work so now I'm a little stumped, I also tried
init_complete with no joy. Any help will be greatly appreciated.

Victoria
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top