runxc1 Bret Ferrier
runxc1 Bret Ferrier

Reputation: 8233

How do you return a partial view with spark?

I am using the SparkViewEngine and I am calling an action that I want to return a Partial View to update just a section of the page. When I return the view on the action the masterpage and all of its content gets returned. How do you tell a partial in spark to just return the content of the partial view and not put the content inside the application.spark file??

Upvotes: 2

Views: 328

Answers (1)

LukLed
LukLed

Reputation: 31862

Do you return PartialViewResult?

public PartialViewResult ActionName()
{
    return PartialView();
}

If you use PartialView(), application.spark is ignored.

Upvotes: 6

Related Questions