Help on MVC3 with razor engine
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Help on MVC3 with razor engine

  1. #1
    Join Date
    Oct 2011
    Posts
    6

    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

  2. #2
    Join Date
    Oct 2011
    Posts
    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.

  3. #3
    Join Date
    Oct 2011
    Posts
    6

    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
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center