0

I have text field that may contain html text (like

<b>Dickens</b>

) in razor view, I display this field with

@Html.TextAreaFor(m => m.CurrentAuthor.AboutAuthorE)

when click in any submit buttons, mvc3 throw exception

A potentially dangerous Request.Form value was detected from the client (CurrentAuthor.AboutAuthorE="<div align=justify><...").

how can I solve this error?

3

1 Answer 1

3

If you need to store basic formatting consider bbcode

www.bbcode.org

A good editor is Markdown http://en.wikipedia.org/wiki/Markdown

If you do require more than the basic formatting that something like Markdown can give you consider adding the AllowHtml attribute to your model

[AllowHtml] 
public string AboutAuthorE { get; set; }

for details see A potentially dangerous Request.Form value was detected from the client

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.