Results 1 to 3 of 3

Thread: Hide page when loading data

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2000
    Location
    Europe, Lithuania
    Posts
    309

    Hide page when loading data

    Hey,

    I got problem described below.

    I have buttons, links in my page. Problem is that users press these buttons and before aplication finishes their work, they press button second or third time, which courses errors.

    How to make page data disapear (while page is postbacking) when button is clicked (for some pages)

    Thanks in advance

  2. #2
    Fanatic Member venerable bede's Avatar
    Join Date
    Sep 2002
    Location
    The mystic land of Geordies
    Posts
    1,018
    Why not just disable the button :

    myButton.enabled = false

    Or do the processing on a seperate page ?

  3. #3
    Frenzied Member Fishcake's Avatar
    Join Date
    Feb 2001
    Location
    Derby, UK
    Posts
    1,092
    the problem with just disabling the button is that until the page is reloaded after postback the button is still on screen for the user to click over and over again calling the OnClick code everytime. You can either disable the button using Javascript or try something like:
    VB Code:
    1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    2.         'Test to see if button still processing
    3.         If Session("clicked") = False Then
    4.             Session("clicked") = True
    5.             'Perform Processing here
    6.             Session("clicked") = False
    7.         End If
    8.     End Sub
    which might work.

    EDIT: If you don't mind using 3rd party controls this one by Andy Smith works very well and is available for free.
    Last edited by Fishcake; Jul 12th, 2004 at 04:49 AM.

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