Reputation: 27585
Razor is encoding every unicode character. How to prevent that?
Example:
This is my Razor:
@Html.DropDownListFor(model => model.Category,
(IEnumerable<SelectListItem>) ViewBag.CategoriesList,
"موضوع صفحه را انتخاب کنید...", new{
@class = "form-control some-css"
})
And this the rendered html:
<select class="form-control some-css" id="Category" name="Category">
<option value="">
موضوع صفحه را انتخاب کنید...
</option>
<option value="SomeValue">
موزه
</option>
<!-- some other options -->
</select>
Upvotes: 3
Views: 435
Reputation: 38499
You could use Html.Raw()
@Html.DropDownListFor(model => model.Category,
(IEnumerable<SelectListItem>)ViewBag.CategoriesList,
Html.Raw("موضوع صفحه را انتخاب کنید..."), new
{
@class = "form-control some-css"
})
Upvotes: 1