Click to See Complete Forum and Search --> : How to disable Image button ?


MMH
March 8th, 2007, 05:01 AM
Hi.. all

i am coding some pages in ASP.NET using C# as codebehind..
i m facing some problems relating image button.
i have to create image button only using codebehind i.e. C#.(dont have aspx for this)

the problem i m facing is, when i click on the button, a lengthy process starts running which i want it to get disabled on click once.

the user should not click on it again...

the place i am setting this button is rendered only once and i have no option to disable it. so i am using javascript in order to disable it on the click event.

my code for that is something like this...

output.AddAttribute(HtmlTextWriterAttribute.Onclick, "javascript:this.disabled='true';");

i cannot use <input> tag here... so is there any other way to disable this button ??


plz help...

Waiting for ur responces...
thanks...

MMH :wave:

sandeep.akhare
March 9th, 2007, 06:25 AM
Hi
What is the problem in the current script i.e is it not working ?

Charu0306
March 9th, 2007, 06:57 AM
he asks for ANY other way. As I understand, if you are generating the button at runtime and not as a design control, you can still have control over its properties.