Set multiple line attribute for html helper textboxfor.

poojasureshkumar
poojasureshkumar used Ask the Experts™
on
Hi All,
Advance thanks!
Using C#, mvc , bootstrap.
I need a help to set multiple line attribute on text box.

@Html.TextBoxFor(m => m.Other, new { id = "txtOther", @class = "textBoxmulti" })


.textBoxmulti {
            border: 1px solid #e2e2e2;
            background: #fff;
            color: #333;
            font-size: 1.0em;
            margin: 5px 0 6px 0;
            padding: 5px;
            width: 800px;
            height: 40px;
      }


Model
======
            [Display(Name = "Other Changes")]
            [DataType(DataType.MultilineText)]
            public string Other { get; set; }

Still not accepting new line.

Kind regards,
Pooja
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Chief Technology Ninja
Distinguished Expert 2018
Commented:
Hi poojasureshkumar,

Instead of
@Html.TextBoxFor(m => m.Other, new { id = "txtOther", @class = "textBoxmulti" })

Open in new window

Use
@Html.TextAreaFor(m => m.Other, new { id = "txtOther", @class = "textBoxmulti" })

Open in new window

Regards,
Chinmay.

Author

Commented:
hi Chinmay,
not working .

Kind regards,
Pooja

Author

Commented:
Thanks Chinmay:)
Chinmay PatelChief Technology Ninja
Distinguished Expert 2018

Commented:
Glad it worked out Pooja. So what was the issue when it did not work for the first time? :)

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial