Environment description:
Software Environment: asp tutorial. net mvc3 + vs2010
System environment: windows xp sp3
Browser: ie8 (for peace in the world, for social stability, and not to be despised by everyone. I have already abandoned ie6 !)
In the previous article, we talked about the configuration of fckeditor in asp.net and its foreground methods.
We receive view data in the controller.
[Httppost]
Public actionresult index (formcollection form)
{
String a = form ["content"];
Return view ();
}
Of course, we all think it is very good here. When we download the breakpoint to return view!
Unfortunately, the tragedy happened as shown in the figure below.
Unfortunately, the html we passed is encoded! Although this encoding mechanism has brought us a lot of trouble! But it makes our program safer! Avoid unnecessary cross-site attacks and one-sentence Trojans!
Of course, if you want to pop up a dialog box that appears when someone opens your page, it will be very unfortunate.
Pull back to the question. Here we need a non-encoded content, so we need to modify the program to decode the encoded html code. The code is as follows:
[Httppost]
Public actionresult index (formcollection form)
{
String a = server.html decode (form ["content"]);
Return view ();
}
Of course, the results will be shown in the following figure.
OK! The entire article is ko!