eyesofalicker
New Member
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've heard that I might have to use DHTML. Could anyone give me an example?<BR>Thank you,<BR><BR><BR>RimmaMy 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 <div> or <span>. But in order to actually change a property of a server control you'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.'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><input type="button" onClick="this.disabled"><BR><BR><BR>