在GRIDVIEW里面,我现在想双击得到选中这行的内容,并到达下一个页面(详细页面),怎么做啊
要详细的.........
要详细的.........
解决方案 »
- IIS7.0 7.5版本出现的问题(未将对象引用到实例)
- 求DES加密
- 技术不是很通,如何带领一个5人WEB软件开发团队,大家给点意见啊!
- 求sitemapPath绑定web.sitemap的实例
- js远程读取http://tf.school.zxxk.com/DSocket.aspx?method=datalist&channelid=15数据
- WEB页面与OCX传值的问题
- 如何根据条件显示datelist某字段内容
- a.aspx 文件中用vb.net,然后在a.aspx.vb中也用vb.net 行吗?
- listbox添加的问题?
- 刚才运行水晶报表,出现以下错误提示,是不是因为没有注册的原因啊?
- List<>有什么好处?
- 关于用户验证和MD5加密
Page1.aspx
protected void GridView1_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
{
Response.Redirect("Page2.aspx?ID=" + e.NewEditIndex);//e.NewEditIndex绑定反点击的行所显示的信息
}本页的GridView和Page2.aspx中的FormView用同样的数据进行绑定
Page2.aspx
protected void Page_Load(object sender, EventArgs e)
{
int Index = int.Parse(Request["ID"].toString());
fvAutomobile.ChangeMode(FormViewMode.Edit);//更改FormView的显示模板为编辑模板
fvAutomobile.PageIndex = Index;//绑定反点击的行所显示的信息
//e.Cancel = true;
}
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
DataRowView drv = (DataRowView)e.Row.DataItem;
e.Row.Attributes["ondblclick"] = "location.href='details.aspx?id=" + drv["字段名"] + "'";
}
}
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("ondblclick", "javascript:OpenDetail(this)");
}
}js:
function OpenDetail(obj)
{
window.open("url?ID="+obj.cells[2].innerHTML);
}
url 是你详细页面。
{
int index; if (e.Row.RowType == DataControlRowType.DataRow)
{
index = e.Row.RowIndex;
for (int i = 1; i < e.Row.Cells.Count; i++)
{
string str = e.Row.Cells[1].Text.ToString();
e.Row.Cells[i].Attributes["onMouseover"] = "this.style.cursor='hand'";
e.Row.Cells[i].Attributes["onClick"] = "window.open('GGdetails.aspx?title="+str+"','','width=600px,height=400px,top=250px,left=350px')";
}
}
}