Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ListBox

Status
Not open for further replies.

coily

Technical User
Jan 26, 2005
25
GB
Hi,

I have a VB.NET web form with a listbox. The page is set to past back when the selected item changes in the listbox. The problem I have is that when the page reloads the selected item is always on top. This is not what, I want I would like the list to remain in the postion it was posted.

Does anyone have any Ideas as to how I can stop this happening?.

Thanks

Olly
 
in the Page_Prerender event:

ListBox.selectedIndex=-1

Known is handfull, Unknown is worldfull
 
Where are you loading the list box? Check if it is a post back..

In the page load event ...

If NOT IsPostBack THEN
... bind the listbox ...
END IF
 
>>The problem I have is that when the page reloads the selected item is always on top

hm misread ur post, jbenson's is the correct method...

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top