Reputation: 21
Here is the example:
<script> function getString(){ var a = "something"; return a;} </script>
and razor example:
string a = "javascript return" or getString();
is that possible?
Upvotes: 0
Views: 480
Reputation: 133403
You wont be able to convert JavaScript variable/function call to a Razor variable. Razor variable is handled by Razor engine on server where as JavaScript on the other hand is a client side language running on the client.
Razor is a view engine used by the ASP.NET MVC framework running on the server to produce some HTML template.
Upvotes: 1