How can I access attributes of Html elements in ASP.NET MVC

Posted by Richard77 on Stack Overflow See other posts from Stack Overflow or by Richard77
Published on 2010-04-15T12:06:10Z Indexed on 2010/04/15 22:23 UTC
Read the original article Hit count: 286

Filed under:
|
|
|

With ASP.NET Webforms, I could drag and drop a control on a form and be able to access its properties:

if (number == 0)
   AddButton.Enabled = false;

Although I cannot drag and drop a control on a ASP.NET MVC View template, can I change its attributes?

For instance:

  • disable a button in some conditions and be able to enable it if conditions change.
  • Be able to change the text of a button from "Next->" to "Finish"
  • etc.

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about html