why my form is doing postback when i am calling asynchronously?

Posted by Abu Hamzah on Stack Overflow See other posts from Stack Overflow or by Abu Hamzah
Published on 2010-05-12T19:20:41Z Indexed on 2010/05/12 19:24 UTC
Read the original article Hit count: 171

Filed under:
|

i am using simple asp.net webpage with few fields on it and when the user click on submit button i am calling asynchronously and posting the data.

BUT, my whole page is posting back and i dont even see the message that i am trying to display if my data got posted succfully.

here is my page.


Requester Page


Name:

    <asp:Label runat="server" ID='Label4'  >Host Name:</asp:Label>
                <asp:TextBox ID="txtHost" runat='server'></asp:TextBox>

    <asp:Label runat="server" ID='Label2'  >Start Date:</asp:Label>
                 <asp:TextBox ID="txtStartDate" runat='server'  ></asp:TextBox>

    <asp:Label runat="server" ID='Label6'  >End Date:</asp:Label>
                <asp:TextBox ID="txtEndDate" runat='server'  ></asp:TextBox>        


          <ul>
          <li>
            <button id="btnCancel" name="btnCancel" type="button">
              Cancel</button></li>
          <li>
            <button id="btnReset" name="btnReset" type="reset">
              Reset</button></li>
          <li>
            <button id="btnSubmit" name="btnSubmit" type="submit">
              Submit</button></li>
        </ul>
    </p> 
    </form>
</div>

//Store new Contract Request Methods
    function processCompletedContactStore(response) {

       if (!response) {
           showErrorMsg('No Contacts Returned');
           return;
       }
       else { 
           if (response.Message == 'update') {
               $("#status").fadeTo(500, 1, function() { $(this).html("Updated successfully!").fadeTo(500, 150); })
           }
       } 
    }

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about AJAX