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

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -