1

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?

1

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Thats fair enough its answered my question in one way

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.