You are close you want to use @Html.Raw(str)
@Html.Encode
takes strings and ensures that all the special characters are handled properly. These include characters like spaces.
More Related Contents:
- How to get DropDownList SelectedValue in Controller in MVC
- How to get the public IP address of a user in C#
- Passing data between different controller action methods
- How to update a claim in ASP.NET Identity?
- Proper JSON serialization in MVC 4
- Windows Authentication and add Authorization Roles through database – MVC asp.net
- {version} wildcard in MVC4 Bundle
- How to route EVERYTHING other than Web API to /index.html
- MVC4 – Bundling does not work when optimizations are set to true
- How to create Select List for Country and States/province in MVC
- LINQ to Entities does not recognize the method ‘System.String ToString()’ method in MVC 4
- How do I do pagination in ASP.NET MVC?
- How do I export to Excel?
- MVC which submit button has been pressed
- Passing object in RedirectToAction
- Visual Studio 2015 not syntax highlighting razor nor Intellisense
- Does FileStreamResult close Stream?
- Display custom error page when file upload exceeds allowed size in ASP.NET MVC
- pass two models to view [duplicate]
- ASP.NET MVC 4 + Ninject MVC 3 = No parameterless constructor defined for this object
- TempData null in asp.net core
- Update multiple records at once in asp.net mvc
- ASP.NET Identity – Multiple object sets per type are not supported
- onchange event for html.dropdownlist
- How to force BundleCollection to flush cached script bundles in MVC4
- Could not load file or assembly ‘System.Net.Http.Formatting’ or one of its dependencies. The system cannot find the path specified
- How to create custom additional fields in UserProfile in MVC4
- WCF Service or Web API [closed]
- Unable to resolve service for type ‘Microsoft.AspNetCore.Identity.UserManager` while attempting to activate ‘AuthController’
- How do I maintain ModelState errors when using RedirectToAction?