Reputation: 2157
Hello guys,
I have created one textarea in my application.
And now i want to add HTML tags in my textarea and want to accept it using following tag
@Html.TextBoxFor(model => model.PageTitle, new { style = "Width:500px; maxlength=500;" })
It doesn't allow HTML code but the simple text. So what should i do for that???
Upvotes: 0
Views: 1954
Reputation: 11203
apply the following attribute to the property PageTitle
:
[AllowHtml]
public string PageTitle { get; set; }
Upvotes: 3
Reputation: 101614
Two options:
@Html.TextBox
which does have the overload to use custom HTML attributes. This is assuming you meant attributes and not tags as your example code implies.
Upvotes: 0