ASP.NET MVC Interface Controls - Enable / Disable


Button:
Click Me!


Checkbox:
Select Me!


Dropdown List:


Radio Button:
Option 1
Option 2


Textbox:


 
 


To enable / disable the controls on the client-side, use the enable / disable methods.
On the server-side, use the Enabled property.
C#
 
    Html.Obout(new OboutButton("btn1") { Enabled = "true" })
Html.Obout(new OboutCheckBox("chk1") { Enabled = "true" })
Html.Obout(new OboutDropDownList("ddl1") { Enabled = "true" })
Html.Obout(new OboutTextBox("txt1") { Enabled = "true"})
Html.Obout(new OboutRadioButton("rbtn1") { Enabled = "true" })
JavaScript
btn1.enable(); btn1.disable();
ddl1.enable(); ddl1.disable();
txt1.enable(); txt1.disable();

"Thank you very much for your support. It is actually quite nice to receive lightning fast responses especially when one is on the other side of the world."

Clinton Morrison

Random testimonial   All testimonials