Results 1 to 5 of 5

Thread: Ext Js and asp.net

  1. #1
    Sencha User
    Join Date
    Aug 2009
    Posts
    3

    Default Ext Js and asp.net

    Hi All,
    I have code snipped like this:
    in asp ------
    JavaScriptSerializer serializer = newJavaScriptSerializer();
    try
    {
    db.clients.InsertOnSubmit(newAccount);
    db.SubmitChanges();
    var x = new
    {
    success =
    true,
    data =
    new { }
    };
    Response.Write(serializer.Serialize(x));
    Response.End();
    }
    catch (Exception ex)
    {}
    in js-------
    buttons: [{
    text:
    'Save',
    handler:
    function() {
    if (tab2.form.isValid()) {
    tab2.getForm().submit({
    waitMsg:
    'In processing',
    scope:
    this,
    failure:
    function(form, action) {
    if (action.failureType == 'server') {
    obj = Ext.util.JSON.decode(action.response.responseText);
    Ext.Msg.alert(
    'Warning!', obj.errors.reason);
    }
    else {
    Ext.Msg.alert(
    'Warning!', 'Fail to save data. ' + action.response.responseText);
    }
    },
    success:
    function(form, action) {
    Ext.MessageBox.show({
    title:
    'Success:',
    msg: action.response.responseText,
    modal:
    true,
    buttons: Ext.MessageBox.OK,
    icon:Ext.Msg.ERROR
    });
    }
    });
    }
    --------
    it is ok except that....when i click save button.....waitMsg never stop. any suggestion to resolve it? thanks.

  2. #2
    Sencha User
    Join Date
    Apr 2008
    Location
    West Linton, Scotland
    Posts
    244

    Default breakpoint in asp code

    Does your form submission hit the asp code?
    Have you tried sticking a breakpoint in your asp code to see if it is getting executed?

    Best to format your formatted code in code tags. It helps people pick up any issues in your code.

  3. #3
    Sencha User
    Join Date
    Aug 2009
    Posts
    3

    Default

    i'll try to debug this problem. I think at this...
    -----------------------------------
    var x = new
    {
    success =
    true,
    data =
    new { }
    };
    Response.Write(serializer.Serialize(x));
    Response.End();

    ---------------------------------
    'success: true' never sendback to ext js, so my ext js still wait for the result. maybe someone can give me suggestion ?

  4. #4

    Default

    At the very least, you need to Response.Clear() before you Response.Write().
    harley.333 - Harley Jones
    [email protected] - Find me on Google Talk.

  5. #5
    Sencha User MiamiCoder's Avatar
    Join Date
    Mar 2009
    Location
    Miami, FL
    Posts
    144

    Default

    1. Try reaching your asp.net page with a browser and verify that it outputs what your client code expects.
    2. Attach the debugger to the page and confirm that your request from the client is reaching the page's load event. If it does, you will be able to step through the code and see where it breaks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •