Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get a value from external java script file to code behind file?

Tags:

c#

.net

c#-4.0

I am developing a web application using .NET4.0 and C# languge. In that application I have a aspx page and corresponding java script file. I need to access the value present in the external java script file in code behind file. How can I access that? I linked external java script and aspx page through ControlResources. Anyone please help in this issue. Thanks in advance.

like image 777
P.Muralikrishna Avatar asked Mar 04 '26 06:03

P.Muralikrishna


1 Answers

The only way JS can communicate with the server side code (at run time) is by a HTTP POST.

if you are talking about getting a constant value on the JS file the only way you have is by opening the JS file in read mode an get what you need (even if I would not suggest you to go down this road)

like image 132
Massimiliano Peluso Avatar answered Mar 05 '26 20:03

Massimiliano Peluso



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!