MVC @ Html. Raw () usage, mvc@html.raw usage
@ Html. Raw () method outputs a string with html tags,
For example: @ Html. Raw ("<div style = 'color: red'> output string </div> ")
Result: The output string is a string in red)
Use Html. Raw in Razor (this method is recommended)
Summary of Html. ActionLink usage1. Html. the first parameter of ActionLink ("linkText", "actionName") is the text to be displayed. The second parameter is the view name, for example, <% = Html. actionLink ("Jump to About page", "About"); %> → <a href = "/Home/About"> jump to the About page </a> 2. Html. actionLink ("linkText", "actionName", "controlName") first parameter: the text to be displayed, second parameter: View name, third parameter: controller name for example: <% = Html. actionLink ("jump to another controler", "Index", "Home "); %> → <a href = "/Home/Index"> jump to another controler. </a> 3. Html. actionLink ("linkText", "actionName", routeValues) The first parameter is the text to be displayed. The second parameter is the view name. The third parameter is the url parameter <% = Html. actionLink ("Jump to the About page", "About", new {id = "1", name = "x "}) %> → <a href = "/Home/About/1? Name = x "> jump to the About page </a> 4. Html. actionLink ("linkText", "actionName", routeValues, htmlAttributes) first parameter: Text to be displayed, second parameter: View name, third parameter: parameter in url, fourth parameter: Set tag attributes such as: <% = Html. actionLink ("Jump to the About page", "About", new {id = "1", name = "x"}, new {disabled = "disabled ", @ class = "about"}) %> → <a class = "about" disabled = "disabled" href = "/Home/About/1? Name = x "> jump to the About page </a> Note: When setting the class attribute of a tag, add @ before the class because the class is a keyword.