从RowCommand获取数据 [英] Get data from RowCommand

查看:111
本文介绍了从RowCommand获取数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Guy's,

我有一个显示产品版本的网格,并有一些链接按钮,例如编辑,删除,预览等.
在单击编辑按钮时,我想获取产品ID和版本ID并重定向到某些xyz.aspx页面,以便可以编辑产品详细信息.
这是我的网格的外观.

Hello Guy''s,

I have a grid which shows product version''s and have a few link buttons like edit, delete, preview etc.
On click of edit button i want to get the Product ID and Version ID and redirect to some xyz.aspx page wher the product details can be edited.
Here is how my Grid looks.

<asp:TemplateField HeaderText = "Edit">
<ItemTemplate>
<asp:LinkButton ID="Edit" runat="server" CommandName="Add" >"Edit"</asp:LinkButton>
<ItemTemplate>


这就是我在网格内定义编辑链接"按钮的方式.
单击链接按钮,我正在gridview_RowCommand中进行跟踪.
在这里我想获取VersionID和ProductID并重定向到另一个页面.
请帮帮我.

我是编码的新手.我做了一些谷歌搜索,但没有解决方案对我有帮助.


This is how i have defined my Edit Link button inside the grid.
Click of link button i am tracking in gridview_RowCommand.
Here i want to get the VersionID and ProductID and Redirect to another page.
Please help me.

I am Real New to Coding. I did a bit of google but non of the solutions are helping me.

推荐答案

在链接按钮中定义命令参数

在row_command事件处理程序中,您可以检索命令参数
使用response.redirect转到另一页并将参数作为查询字符串传递.
define command arguments in your link button

in row_command event handeler you can retrieve your command arguments
use response.redirect to go to another page and pass the arguments as query string.


这篇关于从RowCommand获取数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆