Click to See Complete Forum and Search --> : avoid post back event
PPCC
Sep 9th, 2004, 07:35 AM
I am developing web site using asp.net. I have 50 list box controls on the web form.
I want to cancel the selcted item from the listbox.
I am doing that using lstbox.Cancelselection mehtod but postback event fire again which
populate the all listboxes.
On form_load event i am already checking postback event as false.
Now my question is how do i avoid populationg listbox on click of clear button
mendhak
Sep 9th, 2004, 07:41 AM
In the Page Load event, check for
If Not Page.IsPostBack Then
'.....
Magiaus
Sep 15th, 2004, 12:52 PM
Something to remember is that the Page Load fires before the button event. Meaning that even if you load the boxes on every load the clear will still or should still clear them.
Another thing if you Bind the list boxes on every load the SelectedItem will alway be the first item in the list because between it being select and the fireing of any server code using the selected. The list has been rebound and it's selected item set back to 0.
always bind a list inside a Not IsPostBack check.
Listen to the frog he is pretty smart :afrog:
mendhak
Sep 16th, 2004, 02:22 AM
Is it just me or has the text in the first post changed, making me look like a complete idiot? :blush:
Magiaus
Sep 16th, 2004, 08:43 AM
I dunno I only read up until it said listbox
Magiaus
Sep 16th, 2004, 08:44 AM
btw, what does the asian text say?
Magiaus
Sep 16th, 2004, 08:45 AM
you know I think it did change
mendhak
Sep 17th, 2004, 12:02 AM
Originally posted by Magiaus
btw, what does the asian text say?
All your base are belong to us!
Magiaus
Sep 17th, 2004, 02:22 AM
hahahaha
move zig, move zig, move zig
Some one setup us the bomb.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.