Thursday, 20 December 2012

Partial View Rendering methods

I've noticed there are several ways to use Views and PartialViews:

RenderAction, RenderPartial, and "return PartialView"

RenderAction when placed inside HTML, will simply call an Action and Render the View returned (the View returned can be partial view or view?)

RenderPartial will simply retrieve the contents of a View without executing any Controller action.

return View() returns the view with a Layout enabled so you get full HTML page with <html> and <body> tags. return PartialView() on the other hand disables the Layout and you get only the HTML fragment contained in this view.


Thanks
V. K. Rajput
Fokat RnD Team member

1 comment:

  1. oooo very informative
    thanx
    watng for more

    ReplyDelete