aspx Tutorial

.NET Articles,jQuery demo, asp.net with jQuery, online tutorial,Jquery, SilverLight, Javascript, asp.net,JSON, MVC,.NET Articles,demo, Web Services, .NET articles, Sharepoint 2010, visual studio 2010,Aamir Hasan,IT
Advertise Here

Advertize

wwwSW
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="http://www.w3.org/1999/xhtml">
<head runat="server">
   <title>How to pass Javascript value to Server Side</title>
   <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js" type="text/javascript"></script>
   <script type="text/javascript">

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

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

Following is the Default.aspx.cs page script.

   protected void btnClick_Click(object sender, EventArgs e)
   {
       Response.Write(hPassvalue.Value.ToString());
   }

Output

Download

Pass Javascript value to Server Side.zip (1.02 kb)

Live demo

Protected by Copyscape Online Plagiarism Tool

Comments (2) -

male enhancement
male enhancement United States
10/24/2011 4:24:21 AM #

great post.. i really enjoyed it

five fingers shoes
five fingers shoes People's Republic of China
3/27/2012 12:03:02 AM #

GH-Among the vibram five finger, quilted jackets seem to be hogging the limelight at the moment. The skechers shape ups is known for its quality, practicality and style - five fingers vibram quilts give it good insulation for the colder months. skechers shape ups uk come in a variety of colours and styles, some will have http://www.vibram-five-finger.org/ contemporary chest pockets and others have vibram fingers slightly lower down (they usually have extra padding to keep your hands warm during winter). Some of the skechers uk have cord collars to contrast with the Vibram Five Fingers Classic, and all of the jackets have a fully-quilted polyamide lining and Skechers Boiling Point Boots insulation. http://www.skecher-uk.com/

fafafa
fafafa Slovenia
4/23/2012 3:02:44 AM #

http://www.christianlouboutinukk.org   christian louboutin
http://www.tiffanyuks.org   tiffany uk
http://www.gucciukbeltuk.org   gucci belt
http://www.frsaclouisvuittonsac.com   louis vuitton sac
http://www.chanelukoutletuks.org   chanel outlet
http://www.burberryukoutletuk.org   burberry
http://www.poloralphlaurenuko.org   ralph lauren uk

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading

Advertizement 1
Advertizement 2
Advertizement 3
Advertizement 4
Advertizement 5