Click here to Skip to main content
11,490,007 members (61,149 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#4.0 jQuery NoEffort
how to get jquery varible value in c# server side?
Posted 17-Sep-12 20:42pm
bhargavpp1.5K
Edited 17-Sep-12 21:22pm
v2
Comments
Rajeev Jayaram at 18-Sep-12 18:31pm
   
Why do you need this? Any specific reason?
bhargavpp at 19-Sep-12 1:20am
   
yes i have get value from client side using jquery and i want in server side for database insert
Rajeev Jayaram at 21-Sep-12 4:51am
   
For this requirement there are several ways that you can consider doing, see my answer below.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You could store the value in a Hidden Field[^] from jquery and access it via code behind.

Jquery:
$('[id$="HiddenField1"]').val("Your Value");

Aspx:
<asp:hiddenfield id="HiddenField1" runat="server" value="1"/>

(or)

Alternatively you could use Ajax Jquery[^] to call a webservice to perform database insert.

(or)

Use Ajax Page Methods[^].

Hope it helps.
  Permalink  
v2
Comments
bhargavpp at 22-Sep-12 5:46am
   
this is not working i can't getting any value in server side that is set by client side to hiddenfield
Rajeev Jayaram at 24-Sep-12 4:10am
   
Are you new to asp.net?
bhargavpp at 24-Sep-12 5:54am
   
i am not new in .net,we have all data bind from client side means data value is assign to control from Client Side that's way i am asking how to get client side .as per your idea i have tried it but not working.

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 600
1 Andy Lanng 233
2 OriginalGriff 208
3 Maciej Los 160
4 _duDE_ 141
0 Sergey Alexandrovich Kryukov 9,608
1 OriginalGriff 8,475
2 Sascha Lefèvre 3,419
3 Maciej Los 3,106
4 Richard Deeming 2,370


Advertise | Privacy | Mobile
Web03 | 2.8.150520.1 | Last Updated 21 Sep 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100