Click here to Skip to main content
15,936,802 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
can any one reply my que

XML
<%@ 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>
    &nbsp;</td>
<td> </td>
</tr>
<tr>
<td>CountryId </td>
<td>
    <asp:TextBox ID="TextBox2" runat="server" Height="34px" Width="144px"></asp:TextBox>
    </td>
<td>
    &nbsp;</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">&nbsp;</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>
    &nbsp;</td>
<td> </td>
</tr>
</table>

</div>
</form>
</body>
</html>
Posted
Updated 24-Aug-14 21:49pm
v3
Comments
Sergey Alexandrovich Kryukov 25-Aug-14 1:00am    
And what's the problem? This is just a code dump.
—SA
harshavardhan12345678 25-Aug-14 3:07am    
i need json code like this

 
Share this answer
 
Comments
Gihan Liyanage 15-Sep-14 6:20am    
Did you got a solution from my support, I can see you have not accepted any answer.If you are ok with this answer plz accept it. Then any user having same problem can identified it has solved the problem..
no i can't find the answer .....
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900