Saturday, July 9, 2011

Get textbox server control value using jquery in

Retrieve the server control id in the java script (jQuery code) and do as usual
jQuery code for getting the value at the ASPx page.

<html xmlns="">
<head runat="server">
    <script src="scripts/jquery-1.6.1.min.js" type="text/javascript"></script>
    <script type = "text/javascript">
        $(document).ready(function () {

            $("#<%= btnSend.ClientID %>").click(function () {
                alert($("#<%= txtInfo.ClientID %>").val());
                return true;
    <form id="form1" runat="server">
    <div style=" margin : 0px auto">
        <asp:TextBox ID="txtInfo" runat="server"></asp:TextBox>
asp:Button ID="btnSend"  runat="server" Text="Send" />


Source Seller said...

Wonderful blog & good post.Its really helpful for me, awaiting for more new post. Keep Blogging! nopCommerce plugin. It was very informative.

Post a Comment