我在gridview中加了一个BoundField按扭,点击是弹出小窗口输入借书人信息,下面可以打开窗口,但不能获取ID号,查了很久都没有搞定,望指点 protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
string ID = this.GridView1.Rows[rowindex].Cells[0].Text.ToString();
string jsText = "window.open('BorrInf.aspx?ID=" + ID + "','FS_Left','width=400,height=280,left=350,top=240')";
ClientScript.RegisterStartupScript(GetType(), "newWindow", jsText, true);
}
{
string ID = this.GridView1.Rows[rowindex].Cells[0].Text.ToString();
string jsText = "window.open('BorrInf.aspx?ID=" + ID + "','FS_Left','width=400,height=280,left=350,top=240')";
ClientScript.RegisterStartupScript(GetType(), "newWindow", jsText, true);
}
解决方案 »
- 各位大哥帮忙给看一下以下代码有什么错误
- c# 创建文本文件无效!疑难杂症!求高手!
- 如何使用C#实现查看w3wp进程的信息
- 如何在c#做脚本语言而编写的asp.net中,得到客户端计算机的ip地址
- 请问:1.如何实现按Enter键而响应Tab?2.为何Focuse()不起作用?3.如何定义一个按钮的快捷键(CTRL+而非ALT+)
- XML简单问题,顶顶也有分
- 谁能提供一些关于界面编程方面的资料、代码
- 请教关于DataGrid中两个DropDownList的动态关联?
- arraylist出错,各位帮我看一下?
- 方法在哪些条件下是必须要声明为static
- 呼救dds.Fill(ddt)报错,标准表达式中数据类型不匹配。
- Dotfuscator混淆C#生成的dll,无法被其他程序集调用
<a href='<%# "javascript:window.open(\"a.aspx?ID=" + Eval("ID")+ "\",null,\"width=300,height=200\");void 0;" %>'><%# Eval("Name")%></a>
</ItemTemplate>
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if(e.CommandName == "")
{
string id = GridView1.DataKeys[Convert.ToInt32(e.CommandArgument)].Value.ToString();
string script = string.Format("window.open('Default2.aspx?id_1={0}');",id );
ClientScript.RegisterStartupScript(GetType(), "open", script, true);
}
int index = Convert.ToInt32(e.CommandArgument);
DataKey key = this.GridView1.DataKeys[index ];
int tt = Convert.ToInt32(key.Value.ToString());