user3294008
user3294008

Reputation: 61

AutoPostBack ONCE on pageload

I have a listview with a dropdown, with autopostback enabled.

The user can select yes - which postsback and brings up loads more dropdowns, no - which brings up a textbox, and blank - which does nothing.

As the original dropdownbox is databound it displays one of those values but at the moment always acts as if it was blank ie no other controls showing..

Can I make the page do ONE autopostback as soon as it's loaded without any user input to display the correct controls if it's a yes or no as opposed to blank?

Upvotes: 0

Views: 497

Answers (1)

Sandeep
Sandeep

Reputation: 1210

try calling dropdownbox_selectedindexchanged(null,null) after binding in page load. it is just calling selectedindexchanged event programmatically. as far as i know you want to load controls based on dropdown selection when page first load and user haven't changed dropdown value. so this code will call it from code behind.

Upvotes: 1

Related Questions