Results 1 to 9 of 9

Thread: avoid post back event

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2003
    Location
    india
    Posts
    273

    avoid post back event

    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

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    In the Page Load event, check for

    VB Code:
    1. If Not Page.IsPostBack Then
    2. '.....

  3. #3
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267
    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
    Magiaus

    If I helped give me some points.

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Is it just me or has the text in the first post changed, making me look like a complete idiot?

  5. #5
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267
    I dunno I only read up until it said listbox
    Magiaus

    If I helped give me some points.

  6. #6
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267
    btw, what does the asian text say?
    Magiaus

    If I helped give me some points.

  7. #7
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267
    you know I think it did change
    Magiaus

    If I helped give me some points.

  8. #8
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Originally posted by Magiaus
    btw, what does the asian text say?
    All your base are belong to us!

  9. #9
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267
    hahahaha

    move zig, move zig, move zig

    Some one setup us the bomb.
    Magiaus

    If I helped give me some points.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width