ASP.NET MVC3 WebGrid format: parameter

后端 未结 3 951
北海茫月
北海茫月 2021-01-04 09:23

I am trying to use the new WebGrid in ASP.NET MVC3 and one of the columns I want to display set of link icons that performs various actions (Edit, View, Delete)... For this

3条回答
  •  梦谈多话
    2021-01-04 09:31

    grid.Column(format: (item) => Html.ActionLink("EditCustomer","Editcustomer", new {CustomerId=item.CustomerId}))
    

    This will work ,and above one also work.. Here 1st "EditCustomer" is the text to be visible to users , second "EditCustomer" is the name of action you want it to redirect , and item is

提交回复
热议问题