brian4342
brian4342

Reputation: 1253

How to convert javascript variable to a Razor variable?

lets say i have a javascript variable such as:

var something = "information";

I now want to do things with this variable in Razor

@string something2 = something;

I would like to do something similar to the above code, any ideas?

Upvotes: 1

Views: 1419

Answers (1)

Satpal
Satpal

Reputation: 133453

You wont be able to convert JavaScript variable to a Razor variable. Where Razor variable is handled by Razor engine 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: 2

Related Questions