Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想从 javascript 调用
window.open("< full URL to my '/controller/action/id' >", "My test page")
在 Razor 中,但我不知道该怎么做。
谁能帮助我。
您可以使用上的Action方法UrlHelper。
Action
UrlHelper
您可以使用UrlHelper该属性在您的视图中访问Url:
Url
<script type="text/javascript"> window.open("@(Url.Action("Index", "Home", new { id= 1}))", "My test page") </script>