Can ASP.NET MVC html helpers render an element without an ID attribute?

Posted by thekaido on Stack Overflow See other posts from Stack Overflow or by thekaido
Published on 2010-03-08T00:17:01Z Indexed on 2010/03/08 9:21 UTC
Read the original article Hit count: 352

Filed under:
|

Assume I want to generate an element similar to this in ASP.NET MVC 2:

<%= Html.TextBoxFor(p => p.FooBar)%>

Is there an overload or way I can get ASP.NET MVC 2 to only generate a name attribute and not an ID attribute?

I can have it generate a blank id with <%= Html.TextBoxFor(p => p.FooBar, new { id = "" })%>, but I would like to generate the element with no ID at all, and without overriding the asp.net mvc framework.

© Stack Overflow or respective owner

Can ASP.NET MVC html helpers render an element without an ID attribute?

Posted by thekaido on Stack Overflow See other posts from Stack Overflow or by thekaido
Published on 2010-03-08T00:17:01Z Indexed on 2010/03/08 0:17 UTC
Read the original article Hit count: 352

Filed under:
|

Assume I want to generate an element similar to this in ASP.NET MVC 2:

<%= Html.TextBoxFor(p => p.FooBar)%>

Is there an overload or way I can get ASP.NET MVC 2 to only generate a name attribute and not an ID attribute?

I can have it generate a blank id with <%= Html.TextBoxFor(p => p.FooBar)%>, new { id = "" }, but I would like to generate the element with no ID at all.

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about asp.net-mvc-2