Return a Partialview in ASP.NET MVC

Asked

Viewed 262 times

1

On returning a Partialview my action can both have as a return Actionresult as a Partialviewresult.

public PartialViewResult Franquias()
{
    return PartialView("_Franquias");
}

Or

public ActionResult Franquias()
{
    return PartialView("_Franquias");
}

The following question Difference between Viewresult and Actionresult already speaks on the subject, however my doubts are:

What would be the difference between the two options? (this has already been answered /a/124688/5846)

But still remains the following doubt: On the return of my Action, when it makes a return PartialView, what would be more appropriate to use, the Actionresult or the Partialviewresult?

  • I don’t see it as duplicated, because the other question is about Viewresult and Actionresult and mine is about Partialviewresult and Actionresult, although the answer talks about what each of the types is, but my question is not answered there.

  • Pablo, it’s duplicated because the answer is exactly the same.

  • what would be the difference between each yes, is answered there, but what would be more appropriate to use is not answered in that question

  • @Pablotondolodevargas you would like to know what are the appropriate scenarios to use the PartialView or when to use?

  • @cat made an edit on the doubt. I think now it’s become clearer

  • @Pablotondolodevargas The other dup answers another question.

  • Now I agree that it is duplicated, when I researched about it I only searched inside the C tag#.

Show 2 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.