开发者

MVC 3 Webgrid column to hold image

开发者 https://www.devze.com 2023-02-25 09:10 出处:网络
I am creating a WebGrid in ASP.NET MVC 3 for the first time and I need to create a column that holds a \"star\" image.A user shoul开发者_StackOverflowd be able to select on this image which would mean

I am creating a WebGrid in ASP.NET MVC 3 for the first time and I need to create a column that holds a "star" image. A user shoul开发者_StackOverflowd be able to select on this image which would mean that they have selected it as a favorite. Then, I would have to get the transaction id of that row and save it using jquery.

Any help or examples with syntax would be appreciated. I am not using Razor.


You can start with something like this:

grid.Column(header: Favorite,
format: @<text><a href="@Url.Action("Favorite", "User", new { id = item.Id })" >
<img src="../../Content/Images/favorite.png"
 alt="YourText" title="YourText"
 width:"32px" height="32px"></a></text>)
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号