Hi everyone, I'm using MVC3 Razor for a web based project, as usual it has a _Layout.cshtml and several View page binded to Layout.cshtml. What I want to do is; When the user click on a Url.Action menu button placed on "_Layout.cshtml" it must be redirect
dealing sub-view, url bar can be change but not whole page refresh. Only "RenderBody" section can be refreshed and it must be appear with something Jquery Fade In-Fade Out effect. I think it can be made with Jquery.Load() on MVC Partial View but how? Can you
give me an example or tutorial for this? Thanks by now.
hacktor
Member
21 Points
66 Posts
Partial Load of Sub-View
Nov 23, 2012 01:24 PM|LINK
Hi everyone, I'm using MVC3 Razor for a web based project, as usual it has a _Layout.cshtml and several View page binded to Layout.cshtml. What I want to do is; When the user click on a Url.Action menu button placed on "_Layout.cshtml" it must be redirect dealing sub-view, url bar can be change but not whole page refresh. Only "RenderBody" section can be refreshed and it must be appear with something Jquery Fade In-Fade Out effect. I think it can be made with Jquery.Load() on MVC Partial View but how? Can you give me an example or tutorial for this? Thanks by now.
ignatandrei
All-Star
134491 Points
21566 Posts
Moderator
MVP
Re: Partial Load of Sub-View
Nov 23, 2012 01:48 PM|LINK
Ajax.
Please see http://bit.ly/mvc_ajax_jquery
hacktor
Member
21 Points
66 Posts
Re: Partial Load of Sub-View
Nov 27, 2012 03:11 PM|LINK
Actually I want to Ajax load only @RenderBody section (with Loading gif animation and fadein). So is there any idea about it?
Young Yang -...
All-Star
21111 Points
1817 Posts
Microsoft
Re: Partial Load of Sub-View
Nov 30, 2012 01:07 AM|LINK
I think you can look at these thread: http://stackoverflow.com/questions/1570127/render-partial-view-using-jquery-in-asp-net-mvc & http://stackoverflow.com/questions/5210548/jquery-load-with-asp-net-mvc-partial-view
Hope this helpful
Regards
Feedback to us
Develop and promote your apps in Windows Store
ashoksudani
Participant
1043 Points
213 Posts
Re: Partial Load of Sub-View
Nov 30, 2012 05:42 AM|LINK
as per my knowlage it is not posible that only your Boby part is Refresh when you use Url.Action.
for this you need to use Jquery in place of Url.Action.
in your meny you need to Call one Jquery Function in ajax call to Action method and replace HTML in your Body.