-1

I have a regular ajax call where the server side returns a partial view (html). I now have a situation where i need the server to passback some additional data besides the partial view. The only thought i had was to change the return to json and shove the partial view HTML into a json field but that seemed hacky.

Is there anyway to return a partial view from the server as well as other some other info?

leora
  • 188,729
  • 360
  • 878
  • 1,366
  • It depends who will consume that data. You can use the response header, for example. – Adriano Repetti Sep 28 '12 at 23:55
  • I found this site that seems to indicate this approach is not so crazy:http://craftycodeblog.com/2010/05/15/asp-net-mvc-render-partial-view-to-string/ – leora Sep 28 '12 at 23:56

1 Answers1

0

I went with this solution that seems to do the job: http://craftycodeblog.com/2010/05/15/asp-net-mvc-render-partial-view-to-string/

leora
  • 188,729
  • 360
  • 878
  • 1,366