Click here to Skip to main content
15,893,904 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
hi all..

I have jquery variable in my aspx file.
i want to access that jquery variable value in my aspx.cs file.
how can achieve this..
Posted

Hi,

you cant access that variable directly from your code behind, because jquery is running at client machine.

you can send that value at sever by various ways, but cant access that variable directly.

depending on your app logic & security you can send that value to server.

Thanks
Suvabrata :)
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 31-Dec-12 1:39am    
Good points, a 5. Apparently, OP does not quite understand how the Web and ASP.NET work, what happens on client and server sides. It should be learned first.
—SA
Hi,

Assign that variable value to a hidden field and access that hidden field value in your code behind.
 
Share this answer
 
Comments
Sampath Kumar Sathiya 31-Dec-12 1:58am    
What is wrong with this?
Sampath Kumar Sathiya 31-Dec-12 2:01am    
Can you please explain, what is wrong with this approach?

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900