简体   繁体   English

如何使用javascript将值从webgrid传递到另一个操作页面?

[英]How to pass values from webgrid using javascript to another action page?

I Have a Webgrid in MVC3, it has an edit column. 我在MVC3中有一个Webgrid,它有一个编辑列。 On clicking the column the the ID of the row has to be passed to another action page where I have written the edit action. 单击列时,必须将行的ID传递到另一个操作页面 ,在该页面中我已编写了edit动作。 How can I run a Javascript function on clicking the edit column in the Webgrid? 单击Webgrid中的编辑列时如何运行Javascript函数?

Use this for your edit link in your view: 在您的视图中使用它作为您的编辑链接:

Html.ActionLink(article.Title, 
                "Item",   // <-- ActionMethod
                "Login",  // <-- Controller Name.
                new { ItemID = Model.ItemID }, // <-- Route arguments.
                null  // <-- htmlArguments .. which are none. You need this value
                      //     otherwise you call the WRONG method ...
                )

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM