如何将AngularJS变量传递给Razor函数? [英] How passing AngularJS variables to Razor function?

查看:178
本文介绍了如何将AngularJS变量传递给Razor函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以从Views将angularjs变量传递到razor函数中?

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 = {{angularJSV​​ariable}}})

有可能吗?如果是,该怎么做?如果没有,从AngularJS上下文中实现该目标的正常过程是什么?

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

非常感谢您,

Karine

推荐答案

在不通过服务器的情况下,您无法将任何内容从javascript传递到剃刀.

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

剃刀在服务器端执行,而javascript在客户端...有关更多信息,请检查此

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

这篇关于如何将AngularJS变量传递给Razor函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆