asp.net mvc - I want to store and retrieve html data in mvc by setting validate(false) -


if use @html.raw() html executing well.. people saying displaying data(html) using @html.raw() lead xss attacks.

but alternatively don't have choice display html data in mvc... there way achieve this?

<h1 class="art-heading">@html.displayfor(model => model.article_name)</h1> <div>     @html.displayfor(model => model.article_content) </div> <section>     @html.raw(model.code) </section> 

try use: mvchtmlstring here more information class

public mvchtmlstring outputhtml() {     return mvchtmlstring.create("<div>my div</div>"); } 

then in view:

@outputhtml() 

Comments

Popular posts from this blog

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

android - How to create dynamically Fragment pager adapter -

1111. appearing after print sequence - php -