richtextbox - passing string with html tags to controller in asp.net mvc -
i'm using asp.net mvc2 , want implement rich text area, , passing contents in textarea controller. however, found since contents of rich text area contains html tags, such "
", cannot passed controller. if remove html tags using regex expression, works well.
what can pass these contents containing html tags controller?
2 ways can in case + put line of configuration web.config file
<configuration> <system.web> <pages validaterequest="false" /> <httpruntime requestvalidationmode="2.0" /> </system.web> <configuration> - put 1 attribute (
[validateinput(false)]) onto action want posting on server side
public class dummycontroller : controller { [validateinput(false)] public actionresult save(formdata formdata) { return view(); } }
Comments
Post a Comment