Reputation: 3
Just I am learning MVC,(ofcourse i get enough information from MS Website).I want to quickly clarify some details.
1) What is the use of PartialView in MVC,Is it similar to partial update of Ajax? I am does the partialView modify the HTML DOM structure?
2)Can i use Response.Redirect() in MVC?
Upvotes: 0
Views: 203
Reputation: 22887
Not really, a partial view is more a resuable bit of HTML.
Yes, you can.
Upvotes: 0
Reputation: 1
Partial view is special view which renders a portion of view content. It is just like a user control web form application. Partial can be reusable in multiple views. It helps us to reduce code duplication. In other word a partial view enables us to render a view within the parent view
Upvotes: 0
Reputation: 2703
Dan is right, you can think of partial view as a "serverside" includes, its a pretty nice way to i.e include a login controller functionality, banner rotator. You can also make use of the view model for that particular view you are looking at. Take a look at i.e ui templates in mvc2 thats technicaly a partial view.
yes you can, but you probably want to use RedirectToAction method instead.
Upvotes: 0
Reputation: 825
1) Partial View is more like a UserControl. Update Panels are not fully supported (in my eyes a good thing as they add a lot to page size). You can use them as such:
<div id="logindisplay">
<% Html.RenderPartial("LogOnUserControl"); %>
</div>
2) You can use Response.Redirect in MVC but you may prefer to use RedirectToAction as it will help with your routing if you ever come to change it
return RedirectToAction("Index", "Home");
Upvotes: 4