首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > ASP >

Gridview中每一起有三个按钮,点击分别跳转到不同页面

2013-03-19 
Gridview中每一行有三个按钮,点击分别跳转到不同页面分别为“编辑”“回复”“浏览”,要跳转到不同页面,并且都要

Gridview中每一行有三个按钮,点击分别跳转到不同页面
分别为“编辑”“回复”“浏览”,要跳转到不同页面,并且都要传递GridView的主键给下一个页面。
我把编辑 的CommandName设置为Update
其他的两个按钮的CommandName怎么设置,才能分别取到相同的值但是跳到不同的页面呢?
不知道我说明白没,各位大神,本人菜鸟,帮帮忙吧!!! CommandName GridView
[解决办法]
前台设定CommandName,后台代码如下,其中,case的内容就是前台CommandName设定的值
protected void grvList_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        LinkButton btnSoruce = e.CommandSource as LinkButton;
        string str = e.CommandArgument.ToString();
        string url = string.Empty;
        switch (e.CommandName)
        {

            //変更
            case "***Update":
              break;

热点排行