-1

How to access a javascript object from .js file in C# code behind file .aspx.cs file?

var user={name:"john";age:"12"};

I want to access this user object in C# code behind file.

Rob
  • 26,989
  • 16
  • 82
  • 98
  • 1
    http://stackoverflow.com/questions/245062/whats-the-difference-between-javascript-and-java ... Are you sure you mean "Java object"? – Alexei Levenkov Oct 29 '15 at 05:13
  • Just for stater you can refer this link [Webmethod using Jquery Ajax](http://www.aspsnippets.com/Articles/Calling-ASPNet-WebMethod-using-jQuery-AJAX.aspx) and try impleting the same. – Suprabhat Biswal Oct 29 '15 at 05:21

1 Answers1

0

There are may ways one is you can pass it in query string. Here is a similar question on SO

Use like

str = $.param({name:"john";age:"12"});

and use this str in parameter.

Save individual value to hidden field and then get it in code behind.

Community
  • 1
  • 1
शेखर
  • 17,412
  • 13
  • 61
  • 117