我想在点击带有id的gridview行后,从一个页面重定向到另一个页面。 [英] I want to redirect from one page to another page after clicking on the row of gridview with id.

查看:85
本文介绍了我想在点击带有id的gridview行后,从一个页面重定向到另一个页面。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在点击gridview的gridview一行后,从一个页面重定向到另一个页面。在点击gridview的任何单元格后,它应该被重定向到另一个id.so的页面,通过该id我可以获得关于另一页的信息..并且在绑定之后,当我将光标移动到gridview上时,它应该表明如果我将点击它而不是它将重定向到另一个页面,例如手形符号(光标)。如果有可能请告诉我实际我是新来的告诉我

I want to redirect from one page to another page after clicking on the row of gridview with id.means after clicking any cell of gridview it should be redirected to another page with the id.so that by that id i can get the information on another page..and after binding that when i will move cursor on gridview it should indicate that if i will click on it than it will redirect to another page for example hand symbol(cursor).how it can possible please tell me actually i am new so tell me

推荐答案

允许AutoGenerateSelectButton = true;

在RowCommand事件上

Allow AutoGenerateSelectButton=true;
on RowCommand Event
protected void fect_taskid(object sender, GridViewCommandEventArgs e)
    {
       
            
                int index = Convert.ToInt32(e.CommandArgument);
                GridViewRow row = GridView1.Rows[index]; 
                  Session["id"]=row.Cells[1].Text;// 1 is index for your id
                  Response.Redirect("yourpage.aspx");
      }



希望有所帮助。


Hope it helps.


尝试

Try
protected void Redirect(object sender, EventArgs e)
{
    Server.Transfer("~/yourpages.aspx");
}





然后在Redirect点击事件上调用服务器端方法,使用Server.Transfer重定向。 />
参考链接: - http://www.aspsnippets.com/Articles/Pass-ASP.Net-GridView-from-one-page-to-another-page.aspx [ ^ ]



或尝试给定代码



and then call a server side method on click event for Redirect which using Server.Transfer to redirect.
Reference Link :- http://www.aspsnippets.com/Articles/Pass-ASP.Net-GridView-from-one-page-to-another-page.aspx[^]
and
or try given code

protected void DGridview_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            
            int selectedIndex = int.Parse(e.CommandArgument.ToString());
            string commandName = e.CommandName;
            this.DGridview.SelectedIndex = selectedIndex;
         
        }


http://www.dotnetspider.com/forum/311224-On-click-row-GridView-display-row-details-another-page.aspx [ ^ ]


这篇关于我想在点击带有id的gridview行后,从一个页面重定向到另一个页面。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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