aspx Tutorial

NET Articles,jQuery demo, with jQuery, online tutorial,Jquery, SilverLight, Javascript,,JSON, MVC,.NET Articles,demo, Web Services,
Advertise Here


Get our toolbar!


Posted by Aamir Hasan   on Wednesday, November 10, 2010 Total Views:  

Yesterday some one mail me and asked, how to pass javascript value to server side.Passing javascript value thought server side is very simple.

Here’s is the solution

Following is the Default.aspx page script

<html xmlns="">
<head runat="server">
   <title>How to pass Javascript value to Server Side</title>
   <script src="" type="text/javascript"></script>
   <script type="text/javascript">

       $(document).ready(function () {
           $("#<%=btnClick.ClientID %>").click(function () {
               $("input[id='hPassvalue']").val("welcome to");

   <form id="form1" runat="server">
       <input id="hPassvalue" type="hidden" runat="server" />
       <asp:Button ID="btnClick" runat="server" OnClick="btnClick_Click" Text="Click" />

Following is the Default.aspx.cs page script.

   protected void btnClick_Click(object sender, EventArgs e)



Pass Javascript value to Server (1.02 kb)

Live demo

Protected by Copyscape Online Plagiarism Tool

Add comment

  Country flag

  • Comment
  • Preview

Advertizement 1
Advertizement 2
Advertizement 3
Advertizement 4
Advertizement 5