c# - How do I load views independent of the site.master? -


i'm preparing application wrote in asp.net mvc light ajax-y stuff. basically, want users able go different parts of page without reloading.

to want able reload body of page.

my site master broken down head body , foot div. want able use $("body").load(whateverlink) refresh body, in case doing causes website rendered inside body.

how can successfully?

edit: page made of views, not partialviews. in theory go , convert pages partials i'm looking way around if possible. thanks

you can controllers return partial views, using jquery request , update div page content:

jquery:

function navigate(url){   $.ajax({     url: "/home/index",     cache: false,     success: function(html){        $("#content").html(html);       }    }); } 

controller:

public class homecontroller : controller {         public void index()     {        return this.partialview();     } } 

Comments

Popular posts from this blog

unicode - Are email addresses allowed to contain non-alphanumeric characters? -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

c++ - Convert big endian to little endian when reading from a binary file -