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

Karine
  • 385
  • 1
  • 7
  • 18
  • 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? – Vinod Kumar Y S Oct 10 '14 at 18:46

1 Answers1

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

Community
  • 1
  • 1
M.Azad
  • 3,673
  • 8
  • 47
  • 77