Reputation: 2633
Hi guy i have a javasciprt will create a value , is that any way for me to capture the value in my c# back end code.
function GetKey(){ return Key; } //key is a combination value
Thank you
Upvotes: 0
Views: 975
Reputation: 3725
<script type="text/javascript"> var key = JSON.parse('<%=JsonConvert.SerializeObject(someObj.GetKey()) %>'); //now you can use key in your js logic </script>
Upvotes: 2
Reputation: 35572
C# in backend
public String MyVariable;
MyVariable = "Some Value";
ASPX
<%=MyVariable %>
Upvotes: 3