0

I wrote a filter to return jsonp from a controller action based on some headers and what-not. Problem is, the IDE doesn't know this and it's warning me that I need to create a view or whatever. It's not a big deal, but I'm tired of explaining it to FNGs.

the word "View" is in red

Note: I'm swapping the view out to "Shared/Format/" + format.cshtml, depending on the headers and other factors to use a view to render the callout function and some custom json rendering. The filter makes all that happen, but I still want to return an ActionResult so I can use the view to do some last-minute formatting.

How do I make "View" stop being red?

tereško
  • 58,060
  • 25
  • 98
  • 150
Chris McCall
  • 10,317
  • 8
  • 49
  • 80

1 Answers1

0

IF you're tyring to return JSON, try this:

public JsonResult Save(...) {
    // ...
    return Json(new [] {success});
}

If not (as per your comment), maybe this will help: ASP.NET MVC: How to create an action filter to output JSON?

I suppose you can adapt to use in your JSONP filter.

Community
  • 1
  • 1
Mrchief
  • 75,126
  • 20
  • 142
  • 189