Note that there are some explanatory texts on larger screens.

plurals
  1. POJQuery-Mobile and ASP.Net - AJAX or Postback?
    primarykey
    data
    text
    <p>I've been developing ASP.Net for the past and until recently come across a mobile project. Jquery-Mobile seems perfect as a framework for this, so I just dived into it.</p> <p>Currently I'm using ASP.Net approach to put server controls on a page, then use jqm to enhance those controls to make them looks mobile. I actually do postback to collect form data and process them in code-behind. To avoid a full page refresh, I had to mix them with updatepanel too. Somehow I got them working but deep down I just feel this isn't the right way (or efficient way) of doing it.</p> <p>There's too much complication of mixing things up to get them right, so I think maybe I should just avoid postback and do everything-else in pure AJAX requests?</p> <pre><code>$.ajax({ type: 'POST', url: "/GetName", data: "{}", contentType: "application/json; charset=utf-8" }) .success(function (response) { alert(response); }); </code></pre> <p>Code-behind:</p> <pre><code>[WebMethod ()] public String GetName() { return "Jack"; } </code></pre> <p>Questions:</p> <ul> <li><p>This works, but is this the better way to go with jQuery-Mobile websites, or this is just another bad example?</p></li> <li><p>Is UpdatePanel and postback a bad idea for this scenario? (I know they work)</p></li> <li><p>If AJAX is preferred, how do I go about populating a dropdownlist on pageload (Not server control)? Sending an AJAX request to populate dropdownlist on $(document).ready() seems stupid to me</p></li> </ul> <p>What I'm looking for is rules of thumb of developing a mobile site, I don't want to steer too far away from what should be doing right. Your inputs are very much appreciated. Thanks.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload