<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title></title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js"></script> <script type="text/javascript"> $(function () { $("[id*=Button1]").click(function () { var obj = {}; obj.username = $.trim($("[id*=TextBox1]").val()); obj.countryid = $.trim($("[id*=TextBox2]").val()); obj.isactive = $.trim($("[id*=TextBox3]").val()); $.ajax({ type: "POST", url: "Default.aspx/GetValues", data: JSON.stringify(obj), contentType: "application/json; charset=utf-8", dataType: "json", success: function (r) { alert(r.d); document.getElementById('lblmsg').value = r.d; } }); return false; }); }); </script> <style type="text/css"> .auto-style1 { height: 192px; width: 646px; } .auto-style2 { height: 26px; } .auto-style3 { height: 32px; } </style> </head> <body> <form id="form1" runat="server"> <div> <table ="center" class="auto-style1"> <tr> <td>UserName</td> <td> <asp:TextBox ID="TextBox1" runat="server" Height="26px" style="margin-bottom: 0px" Width="144px"></asp:TextBox> </td> <td> </td> <td> </td> </tr> <tr> <td>CountryId </td> <td> <asp:TextBox ID="TextBox2" runat="server" Height="34px" Width="144px"></asp:TextBox> </td> <td> </td> <td> </td> </tr> <tr> <td class="auto-style2">IsActive</td> <td class="auto-style2"> <asp:TextBox ID="TextBox3" runat="server" Height="24px" Width="147px"></asp:TextBox> </td> <td class="auto-style2"> </td> </tr> <tr> <td> </td> <td class="auto-style3"> <asp:Button ID="Button1" runat="server" Text="Button" /> </td> <td class="auto-style3"> </td> <td class="auto-style3"> </td> </tr> <tr> <td>Result:</td> <td> <asp:Label ID="Label1" runat="server" Text=""></asp:Label> </td> <td> </td> <td> </td> </tr> </table> </div> </form> </body> </html>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)