disabling controls in ASP.NET on the client

Results 1 to 3 of 3

Thread: disabling controls in ASP.NET on the client

  1. #1
    Join Date
    Dec 1969

    Default disabling controls in ASP.NET on the client

    I need to disable controls (once the user clicks the button), but I need to do it right away (before the postback to the server). Any suggestions? I&#039;ve heard that I might have to use DHTML. Could anyone give me an example?<BR>Thank you,<BR><BR><BR>Rimma

  2. #2
    Join Date
    Dec 1969

    Default No... well maybe.. no.

    My first answer is no. Whatever you are trying to do is a bad idea anyways. You can make certain items not visible using dhtml as long as it has a &#060;div&#062; or &#060;span&#062;. But in order to actually change a property of a server control you&#039;ll need to modify the viewstate on the client. And this should never been done. I dont even know if its possible.. If it is possible to change and modify the viewstate then its also possible for a hacker to change it. And thats not good. I think its encrypted.

  3. #3
    Join Date
    Dec 1969

    Default maybe

    &#039;example: add client js to button<BR>Button1.Attributes.Add("onclick", "this.disabled")<BR><BR>this does not really work because asp.net is server based. <BR>once the user clicks the button, the page is posted. So it does not matter if the button is disabled, the page has disappeared. (unless you want to prevent a double post - this will work)<BR><BR>non asp.net example:<BR>&#060;input type="button" onClick="this.disabled"&#062;<BR><BR><BR>

Posting Permissions

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