Environment Description: software environment: asp tutorial. net mvc3 + vs2010 system environment: windows xp sp3 Browser: ie8 (for peace in the world, for social stability, in order 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. Unfortunately, the html we passed was 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 bring up a dialog box that appears when someone else opens your page, it is very unfortunate that a problem may occur. 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 result will be shown in OK! The entire article is ko!