0

it is possible to pass angularjs variable into razor function from Views?

By example, I need to do that things :

@Html.Partial("_ViewName", new Models() { Url = {{ angularJSVariable }} })

It is possible? If yes, how to do that? If no, what is the normal procedure to achieve that from an AngularJS context?

Thank you very much,

Karine

1
  • 1
    What i can understand from you question is that you are trying to retrieve a partial view using ajax. Right? If this is the case, you can create a angularjs service/factory to retrieve the view passing the angularjs variable in the url and get the html that you can inject into the DOM. Is this what you are looking for? Commented Oct 10, 2014 at 18:46

1 Answer 1

2

You cannot pass anything from javascript to razor without going through the server.

Razor executed in server side and javascript is in client side...for more information check this Question

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

Comments

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.