Help with the structure for the single-page Ajax site

I know the rules, and this is actually not a question that can be answered, but I really need help with this.

I am creating a website that has a javascript music player that cannot be interrupted every time a user changes pages. Thus, the site should be a kind of one page, loading ASPX files using AJAX.

What structure should I use for this?

If I use Masterpage with a player and split aspx files, can I download these files using ajax?

Any help with ajax framework or sample would be appreciated.

0
ajax visual-studio-2008 asp.net-ajax
source share
1 answer

I suggest you use the MVC Framework for this. Then you can easily call controller action methods using AJAX client calls. Here's a simplified example:

// jQuery AJAX call. function getContacts() { $.ajax({ type: 'get', url: '/Contacts/GetContacts', dataType: 'json', success: function (response) { var contacts = response; }, error: function (e) { alert('oops!'); } }); } // Server-side. public class ContactsController : Controller { [HttpGet] public JsonResult GetContacts() { JsonResult result = new JsonResult { JsonRequestBehavior = JsonRequestBehavior.AllowGet }; List<Contacts> contacts = DataAccess.GetContacts(); result.Data = contacts; return result; } } 
+1
source share

All Articles