Tell me more ×
Code Review Stack Exchange is a question and answer site for peer programmer code reviews. It's 100% free, no registration required.

I want to create a JavaScript application like gMail with:

Framework: ASP.NET

Browser Framework: jQuery

Database: MySQL

My idea is:

When the window.onhashchange fires up, I load the right content dynamically:

main.loadContent = function (file) {
   $("#content").load(file); } // in this example, users.aspx

the JavaScript file users.js gets loaded too, and on DOM ready, I get some information from the server via AJAX:

$.ajax({
    type: "POST",
    url: "WebService.asmx/GetUsers",
    data: data,
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    success: function (data) {
        // fill the fields
    }
});

the function GetUsers, in the webservice, fires up and returns data from the database:

public class WebService : System.Web.Services.WebService
{
    [WebMethod]
    public void GetUsers()
    {
        try
        {
           return Users.GetUsers(); //some logic and database query
        }
        catch (Exception ex) { Global.HandleException(ex); }
    }
}

So, is this a good way or do you have a better one?

share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.