Help on MVC3 with razor engine
Hi friends,
I am having problem with applying style sheet for
@Html.TextBoxFor(m=> m.ZipCode, new { @class = "zip" })
This way, it is not working , but
@Html.TextBox("Username", null, new {@class = "prjct_textarea"})
This is working, But i can't bind this with model.
Please suggest me a way either to bind @html.TextBox() with models or apply the style sheet class to @Html.TextBoxFor()
any help will be highly appreciated, I am stuck here in the middle of nowhere
Re: Help on MVC3 with razor engine
Hi Iaroi,
We can bind the textbox from model. Instead of null use this.
@Html.TextBox("Username", (Model.ZipCode.ToString()), new {@class = "prjct_textarea"})
Regards,
Priya.
Re: Help on MVC3 with razor engine
Thank you very much Priya, for sharing the knowledge. I went with the TextboxFor<> syntax itself. it was some other problem because of which it didn't pick up the style sheet.
Once again thanks for your reply