Help Needed!!! client-side script, server-side code

Discussion in 'ASP .Net' started by Shawn Mehaffie, Jan 21, 2004.

  1. I have a form when the user clicks on a HTML Input control, a process runs
    to submit the users order. While the process is running I wnat to disable
    the button so the user cannot submit the form again. I have written client
    side code to disable the button which is setup to run onclick. The client
    side function runs (with alert but not code to disabel the button), then the
    form is submitted and the ServerClick event is run. This is how it should
    work according to the documentation.

    The problem I am having is when I add the code to disable the sumbit button
    then the server-side code does not run. Does anyone know of a way around
    this? Is there a way to make the program run the server side code after
    disabling the button?

    I've tried to disable the button in the ServerClick event and run the
    CCSubmit fucntion in a thread, but then the button disables properly but
    does not enable correctly. The other important thing is that if there is an
    error in the CCSumbit function I need to put the message in a label and make
    the label visible. When I try this using a Thread the error message neve is
    made visible either.

    I really need an answer to his ASAP, so any ideas would be appreciated.

    S. Shawn Mehaffie
    PC Resources, LLC.

    P.S. To me being the ability to run client-side and server side code the way
    the documentation says should always run the server-side code, even if the
    client-side disables the control. Other than validation code, the disabling
    of the button that was pressed so users cannot press it again is a top use
    for this feature. By not running the server-side code if you disable the
    control you are putting a big limit on this.
     
    Shawn Mehaffie, Jan 21, 2004
    #1
    1. Advertising

  2. Shawn Mehaffie

    Showjumper Guest

    When the button is clicked, You could send to user to a new page saying
    their order is being processed
    "Shawn Mehaffie" <> wrote in message
    news:...
    > I have a form when the user clicks on a HTML Input control, a process runs
    > to submit the users order. While the process is running I wnat to disable
    > the button so the user cannot submit the form again. I have written

    client
    > side code to disable the button which is setup to run onclick. The client
    > side function runs (with alert but not code to disabel the button), then

    the
    > form is submitted and the ServerClick event is run. This is how it should
    > work according to the documentation.
    >
    > The problem I am having is when I add the code to disable the sumbit

    button
    > then the server-side code does not run. Does anyone know of a way around
    > this? Is there a way to make the program run the server side code after
    > disabling the button?
    >
    > I've tried to disable the button in the ServerClick event and run the
    > CCSubmit fucntion in a thread, but then the button disables properly but
    > does not enable correctly. The other important thing is that if there is

    an
    > error in the CCSumbit function I need to put the message in a label and

    make
    > the label visible. When I try this using a Thread the error message neve

    is
    > made visible either.
    >
    > I really need an answer to his ASAP, so any ideas would be appreciated.
    >
    > S. Shawn Mehaffie
    > PC Resources, LLC.
    >
    > P.S. To me being the ability to run client-side and server side code the

    way
    > the documentation says should always run the server-side code, even if the
    > client-side disables the control. Other than validation code, the

    disabling
    > of the button that was pressed so users cannot press it again is a top use
    > for this feature. By not running the server-side code if you disable the
    > control you are putting a big limit on this.
    >
    >
     
    Showjumper, Jan 21, 2004
    #2
    1. Advertising

  3. Shawn Mehaffie

    Eran Amitai Guest

    How did you submit the form from your client side onclick handler? You're
    supposed to use the GetPostBackEventReference function.

    "Shawn Mehaffie" <> wrote in message
    news:...
    > I have a form when the user clicks on a HTML Input control, a process runs
    > to submit the users order. While the process is running I wnat to disable
    > the button so the user cannot submit the form again. I have written

    client
    > side code to disable the button which is setup to run onclick. The client
    > side function runs (with alert but not code to disabel the button), then

    the
    > form is submitted and the ServerClick event is run. This is how it should
    > work according to the documentation.
    >
    > The problem I am having is when I add the code to disable the sumbit

    button
    > then the server-side code does not run. Does anyone know of a way around
    > this? Is there a way to make the program run the server side code after
    > disabling the button?
    >
    > I've tried to disable the button in the ServerClick event and run the
    > CCSubmit fucntion in a thread, but then the button disables properly but
    > does not enable correctly. The other important thing is that if there is

    an
    > error in the CCSumbit function I need to put the message in a label and

    make
    > the label visible. When I try this using a Thread the error message neve

    is
    > made visible either.
    >
    > I really need an answer to his ASAP, so any ideas would be appreciated.
    >
    > S. Shawn Mehaffie
    > PC Resources, LLC.
    >
    > P.S. To me being the ability to run client-side and server side code the

    way
    > the documentation says should always run the server-side code, even if the
    > client-side disables the control. Other than validation code, the

    disabling
    > of the button that was pressed so users cannot press it again is a top use
    > for this feature. By not running the server-side code if you disable the
    > control you are putting a big limit on this.
    >
    >
     
    Eran Amitai, Jan 21, 2004
    #3
  4. Thanks, but that is not how we want the applications to work. Thanks for
    the suggestion.
    "Showjumper" <> wrote in message
    news:eXuGc$...
    > When the button is clicked, You could send to user to a new page saying
    > their order is being processed
    > "Shawn Mehaffie" <> wrote in message
    > news:...
    > > I have a form when the user clicks on a HTML Input control, a process

    runs
    > > to submit the users order. While the process is running I wnat to

    disable
    > > the button so the user cannot submit the form again. I have written

    > client
    > > side code to disable the button which is setup to run onclick. The

    client
    > > side function runs (with alert but not code to disabel the button), then

    > the
    > > form is submitted and the ServerClick event is run. This is how it

    should
    > > work according to the documentation.
    > >
    > > The problem I am having is when I add the code to disable the sumbit

    > button
    > > then the server-side code does not run. Does anyone know of a way

    around
    > > this? Is there a way to make the program run the server side code after
    > > disabling the button?
    > >
    > > I've tried to disable the button in the ServerClick event and run the
    > > CCSubmit fucntion in a thread, but then the button disables properly but
    > > does not enable correctly. The other important thing is that if there

    is
    > an
    > > error in the CCSumbit function I need to put the message in a label and

    > make
    > > the label visible. When I try this using a Thread the error message

    neve
    > is
    > > made visible either.
    > >
    > > I really need an answer to his ASAP, so any ideas would be appreciated.
    > >
    > > S. Shawn Mehaffie
    > > PC Resources, LLC.
    > >
    > > P.S. To me being the ability to run client-side and server side code the

    > way
    > > the documentation says should always run the server-side code, even if

    the
    > > client-side disables the control. Other than validation code, the

    > disabling
    > > of the button that was pressed so users cannot press it again is a top

    use
    > > for this feature. By not running the server-side code if you disable

    the
    > > control you are putting a big limit on this.
    > >
    > >

    >
    >
     
    Shawn Mehaffie, Jan 22, 2004
    #4
  5. Thanks but I figrued out how to take care of this. The button control
    automatically does a form post and calls ther server-side click event. The
    problem was that in the client side code I was disabling the button, which
    caused the server side code not to work. I am now using the styles.display
    property and simply making the button in question invisible. By doing this
    the button cannot be clicked again and the server-side code still runs.

    Thanks for your suggestion,
    S. Shawn Mehaffie

    "Eran Amitai" <> wrote in message
    news:%2314TxF$...
    > How did you submit the form from your client side onclick handler? You're
    > supposed to use the GetPostBackEventReference function.
    >
    > "Shawn Mehaffie" <> wrote in message
    > news:...
    > > I have a form when the user clicks on a HTML Input control, a process

    runs
    > > to submit the users order. While the process is running I wnat to

    disable
    > > the button so the user cannot submit the form again. I have written

    > client
    > > side code to disable the button which is setup to run onclick. The

    client
    > > side function runs (with alert but not code to disabel the button), then

    > the
    > > form is submitted and the ServerClick event is run. This is how it

    should
    > > work according to the documentation.
    > >
    > > The problem I am having is when I add the code to disable the sumbit

    > button
    > > then the server-side code does not run. Does anyone know of a way

    around
    > > this? Is there a way to make the program run the server side code after
    > > disabling the button?
    > >
    > > I've tried to disable the button in the ServerClick event and run the
    > > CCSubmit fucntion in a thread, but then the button disables properly but
    > > does not enable correctly. The other important thing is that if there

    is
    > an
    > > error in the CCSumbit function I need to put the message in a label and

    > make
    > > the label visible. When I try this using a Thread the error message

    neve
    > is
    > > made visible either.
    > >
    > > I really need an answer to his ASAP, so any ideas would be appreciated.
    > >
    > > S. Shawn Mehaffie
    > > PC Resources, LLC.
    > >
    > > P.S. To me being the ability to run client-side and server side code the

    > way
    > > the documentation says should always run the server-side code, even if

    the
    > > client-side disables the control. Other than validation code, the

    > disabling
    > > of the button that was pressed so users cannot press it again is a top

    use
    > > for this feature. By not running the server-side code if you disable

    the
    > > control you are putting a big limit on this.
    > >
    > >

    >
    >
     
    Shawn Mehaffie, Jan 22, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. nick
    Replies:
    3
    Views:
    3,216
    Eliyahu Goldin
    Dec 15, 2004
  2. Magnus Blomberg
    Replies:
    3
    Views:
    728
    Magnus Blomberg
    Apr 14, 2005
  3. =?Utf-8?B?TWlrZSBSYW5k?=

    Adding Server Side code in a Client Side Script???

    =?Utf-8?B?TWlrZSBSYW5k?=, Jan 30, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    1,163
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Jan 30, 2006
  4. Replies:
    1
    Views:
    938
    Sudsy
    Dec 8, 2004
  5. Timo

    help needed with server-side/client-side issue

    Timo, Apr 7, 2004, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    142
Loading...

Share This Page