ASP.NET DropDown selected text problem - How to retain SelectedIndexChanged data

by Waqas 5/27/2008 8:31:00 PM


There is a common pitfall faced by many ASP.NET developers that they bind their drop down lists in Page_Load and then expect it to maintain its SelectedIndexChanged state across page loads, which in reality never happens.

Actually, that binding should be done in Page_Init so that data binding and its associated event handlers are not being reloaded during Page_Load.

So conclusion is, always bind your drop down list in Page_Init() to avoid selecteditem text loss in asp.net drop down lists.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Tips n Tricks

Related posts

Add comment


(Will show your Gravatar icon)  

  Country flag

biuquote
  • Comment
  • Preview
Loading




Tags

© Copyright Beyond Web Logs.


Recent comments

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008

Sign in