October 3rd, 2011 08:48 AM
#1
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
October 15th, 2011 01:18 AM
#2
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.
October 15th, 2011 07:41 AM
#3
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
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width
Bookmarks