Click here to Skip to main content
Sign Up to vote bad
good
how to get jquery varible value in c# server side?
Posted 17 Sep '12 - 19:42
bhargavpp1.5K
Edited 17 Sep '12 - 20:22

Comments
Rajeev Jayaram - 18 Sep '12 - 18:31
Why do you need this? Any specific reason?
bhargavpp - 19 Sep '12 - 1:20
yes i have get value from client side using jquery and i want in server side for database insert
Rajeev Jayaram - 21 Sep '12 - 4:51
For this requirement there are several ways that you can consider doing, see my answer below.

1 solution

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  
Comments
bhargavpp - 22 Sep '12 - 5:46
this is not working i can't getting any value in server side that is set by client side to hiddenfield
Rajeev Jayaram - 24 Sep '12 - 4:10
Are you new to asp.net?
bhargavpp - 24 Sep '12 - 5:54
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
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 405
1 OriginalGriff 315
2 Maciej Los 240
3 Slacker007 240
4 Aarti Meswania 210
0 Sergey Alexandrovich Kryukov 8,953
1 OriginalGriff 7,134
2 CPallini 3,758
3 Rohan Leuva 3,036
4 Maciej Los 2,488


Advertise | Privacy | Mobile
Web04 | 2.6.130516.1 | Last Updated 21 Sep 2012
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid