By default, strings containing HTML markup such as comments made using a rich text box stored in your database are automatically escaped by Razor. This means <p>This is a paragraph</p> would be automatically translated by Razor into <p>This is a paragraph</p> when the page is run. This is done for mostly security reasons to prevent cross site scripting attacks. If you want Razor to output the HTML exactly as it is stored in your string without escaping it, use the @MvcHtmlString function shown below.
@MvcHtmlString.Create("<p>This is a paragraph.</p>")
우훔 우훔
'C# 이야기' 카테고리의 다른 글
지네릭 타입 파라메터에 델리게이트 넘겨서 호출하기. (0) | 2012.10.29 |
---|---|
Entity Framework 4.X 사용자 정의 쿼리로 Entity Data Model 만들기. (0) | 2011.08.31 |
확장 메서드, Extension Method 개념 잡기!! (1) | 2010.12.15 |
콜백 함수!! 개념 정리~!!! 쿠쿵!! (3) | 2010.12.06 |
이벤트.. ㅋㅋ (0) | 2010.12.02 |