Question

What I'm talking aboit is having a controller like:

[HttpPost, ValidateResult(false)]
public String Preview(String value) {
    return BBCode.ToHtml(value);
}

So user can reference it by url. Is that normal? Probably this is not a high priority question, but I'm just curious?

Thanks!

Était-ce utile?

La solution

Normally controller actions should return ActionResults. So a more correct version of your code would be:

[HttpPost, ValidateResult(false)]
public ActionResult Preview(String value) {
    return Content(BBCode.ToHtml(value));
}
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top