show-notice
hide-notice

Monday, 1 July 2013

insert and display data using web service with java-script


Introduction

Here I will explain how to insert and display data using web service with java-script







 While you can call method with jquery ajax call:



<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" type="text/javascript"></script>
  <script type ="text/javascript">
      $(document).ready(function () {
          $('#<%=Button1.ClientID %>').click(function () {
              $.ajax({
                  type: "POST",
                  url: "WebForm1.aspx/ServerSideMethod",
                  data: "{}",
                 contentType: "application/json; charset=utf-8",
                 dataType: "json",
                 async: true,
                 cache: false,
                 success: function (msg) {
                    $('#myDiv').text(msg.d);
                }
             })
             return false;
         });
     });
 </script>
 

SHARE THIS POST   

0 comments :

Post a Comment

Design by Gohilinfotech | www.gohilinfotech.blogspot.com