If I change the output to Html.Raw then it applies the style to the entire page. What is the correct method for outputting html with the razor view engine?
If I'm understanding correctly - first you enter some text into a WYSIWYG and are saving it. Then you are pulling what you saved back out and it comes with all that styling?
The problem is not how you output HTML using razorengine because Html.Raw is the best method for that. The problem is saving all styling information. You need to disable styling within the WYSIWYG, so that it saves just basic tags, i.e. <p>xxxx</p><h3>dfgfdgfd</h3>
etc. And no <span style...>
HTH's
Regards,
BoogleC
Please mark the right solution as the answer. This helps others find what they're looking for.
AndyJohnson8...
Member
18 Points
8 Posts
Outputting HTML in MVC 3
Feb 22, 2012 01:27 PM|LINK
I have installed the CLEditor package which adds a WYSIWYG editor on my page. However when saving, I basically just get something like:
If I change the output to Html.Raw then it applies the style to the entire page. What is the correct method for outputting html with the razor view engine?
BoogleC
Contributor
2208 Points
445 Posts
Re: Outputting HTML in MVC 3
Feb 22, 2012 02:13 PM|LINK
If I'm understanding correctly - first you enter some text into a WYSIWYG and are saving it. Then you are pulling what you saved back out and it comes with all that styling?
The problem is not how you output HTML using razorengine because Html.Raw is the best method for that. The problem is saving all styling information. You need to disable styling within the WYSIWYG, so that it saves just basic tags, i.e. <p>xxxx</p><h3>dfgfdgfd</h3> etc. And no <span style...>
HTH's
BoogleC
Please mark the right solution as the answer. This helps others find what they're looking for.