c# - Summernote Asp.net MVC HttpRequestValidationException -
i use summernote enable users write html email on website. email submitted if user submits form. since email little more complex additional data use custom modelbinder leads me problem.
i try email text this
argument = request.form[propertyname] //<-- httprequestbase request;
the freemessagemodel looks this.
public class freemessagemodel : basemessagemodel { private mvchtmlstring m_freemessage; private string m_subject; private employeemodel m_employee; public mvchtmlstring freemessage { { return m_freemessage; } set { m_freemessage = value; } } public string subject { { return m_subject; } set { m_subject = value; } } public employeemodel employee { { return m_employee; } set { m_employee = value; } } public string sender { { string = "someadress"); return from; } } public freemessagemodel() { } public string getmailbody() { throw new notimplementedexception(); } }
the request.form[propertyname]
crashes on freemessage
error message httprequestvalidationexception. aware html text interpreted possible security issue. question how can text can decide if dangerous myself ?
i read why httprequestvalidationexception submitting user input raw html? happens after modelbinding process.
so question how can html text during modelbinding without getting httprequestvalidationexception , without turning off validation whole application
i using .net framework 4.0
Comments
Post a Comment