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!

Was it helpful?

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));
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top