How do I retrieve row ID from an MVCContrib HTML Grid?
Posted
by ryandreggs
on Stack Overflow
See other posts from Stack Overflow
or by ryandreggs
Published on 2010-03-23T19:23:04Z
Indexed on
2010/03/23
19:53 UTC
Read the original article
Hit count: 340
Hi,
I currently have a product view page that contains an MVCContrib HTML Grid with a select link at the beginning of each row. If the select link is clicked, it takes me to a different page.
My question is whether it is possible to retrieve the productID from the row that is selected and pass that to the next page.
Maybe this is posible to do with a session variable but im not sure.
Any help would be greatly appreciated.
Thanks in advance.
Here is my view code:
<% Html.Grid((List<System2__MVC2.Controllers.ProductController.ProductsSet>)ViewData["Products"]).Columns(column =>
{
column.For(c => Html.ActionLink("Select", "Products", "Product")).DoNotEncode();
column.For(c => c.ProductID);
column.For(c => c.Name);
column.For(c => c.Description);
column.For(c => c.Price);
}).Render();
%>
© Stack Overflow or respective owner