Last post May 04, 2012 05:46 AM by Mikesdotnetting
Apr 22, 2012 09:35 PM|tonyjoanes|LINK
When posting back a form I am getting the following message
The only thing is that its working with other characters. Has anyone seen this issue occur before, and know how to resolve it?
Apr 22, 2012 09:54 PM|Mikesdotnetting|LINK
Use Request.Unvalidated() to access values that might contain HTML:
var article = Request.Unvalidated("article");
Apr 25, 2012 11:10 PM|tonyjoanes|LINK
I have now used
But when I decode the other side it outputs the actual html tags to the screen?
Allowed the apostrophe through though :)
Apr 26, 2012 05:52 AM|Mikesdotnetting|LINK
If you want to display as HTML, use Html.Raw():
Apr 26, 2012 07:37 AM|tonyjoanes|LINK
This doesn't work for me. I'm encoding into the database and then decoding when I display it.
When collecting the data from a tiny mce control in having to request.invalidated to get it to work with special characters
Apr 26, 2012 01:45 PM|Mikesdotnetting|LINK
Just store the HTML in the database. There is no need to encode and decode.
Apr 26, 2012 02:16 PM|tonyjoanes|LINK
I'm inserting to database from a form and I was getting errors about dangerous content but maybe now I've turned off validation this will work, I'll give it a go
Apr 26, 2012 09:20 PM|tonyjoanes|LINK
@Html.Raw("") isn't working. My text outputs with the html tags visible instread of rendering them.
Into the database is done this way
article = Request.Unvalidated("article");
... insert statements
and then rendered on the page like this
Apr 27, 2012 06:11 AM|Mikesdotnetting|LINK
Have you got a small sample of what is stored in the databse for one of these entries?
May 03, 2012 11:21 AM|tonyjoanes|LINK
This is some data that is in the database
<p>We are awaiting news from Wessex as to whether the weather is going to effect this meeting as well.</p> <p>Watch this space for updates as sadly there is little racing going on at the moment which is a real shame after the team
efforts in the garage through the winter.</p>
May 04, 2012 05:46 AM|Mikesdotnetting|LINK
That's been encoded. You are best off not encoding as I said before, but if you want to display that as HTML, you need to decode
and use Html.Raw: