就是我在使用
<asp:DataGrid>
<asp:TemplateColumn HeaderText="业务分配">
<ItemTemplate>
<asp:ImageButton ID="modifyGIF" runat="server" ImageUrl="../css/images/modify.gif"
CommandName="modifyGIF" />
<%-- <img src="../css/images/modify.gif" style="cursor: hand" onclick="window.open('ywxx_fp.aspx?Entp_ID=<%# DataBinder.Eval(Container.DataItem,"Entp_ID")%>', 'win19','width=700,height=570 ,top=200,left=120');">--%>
</ItemTemplate>
</asp:TemplateColumn>
</asp:DataGrid>在.aspx文件里:<img src="../css/images/modify.gif" style="cursor: hand" onclick="window.open('ywxx_fp.aspx?Entp_ID=<%# DataBinder.Eval(Container.DataItem,"Entp_ID")%>', 'win19','width=700,height=570 ,top=200,left=120');">将其中的绑定数据列转换列...如下:Entp_ID=<%# DataBinder.Eval(Container.DataItem,"Entp_ID")%>在.cs文件里该如何去转换啊!(也就是该如何去写)protected void DataGrid1_ItemCommand(object source, DataGridCommandEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
((ImageButton)e.Item.Cells[0].FindControl("modifyGIF")).Attributes.Add("onclick", "window.open ('ywxx_fp.aspx?Entp_ID=<%#DataBinder.Eval(Container.DataItem,"Entp_ID"', 'win19','width=700,height=570 ,top=200,left=120');");
}
}
<asp:DataGrid>
<asp:TemplateColumn HeaderText="业务分配">
<ItemTemplate>
<asp:ImageButton ID="modifyGIF" runat="server" ImageUrl="../css/images/modify.gif"
CommandName="modifyGIF" />
<%-- <img src="../css/images/modify.gif" style="cursor: hand" onclick="window.open('ywxx_fp.aspx?Entp_ID=<%# DataBinder.Eval(Container.DataItem,"Entp_ID")%>', 'win19','width=700,height=570 ,top=200,left=120');">--%>
</ItemTemplate>
</asp:TemplateColumn>
</asp:DataGrid>在.aspx文件里:<img src="../css/images/modify.gif" style="cursor: hand" onclick="window.open('ywxx_fp.aspx?Entp_ID=<%# DataBinder.Eval(Container.DataItem,"Entp_ID")%>', 'win19','width=700,height=570 ,top=200,left=120');">将其中的绑定数据列转换列...如下:Entp_ID=<%# DataBinder.Eval(Container.DataItem,"Entp_ID")%>在.cs文件里该如何去转换啊!(也就是该如何去写)protected void DataGrid1_ItemCommand(object source, DataGridCommandEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
((ImageButton)e.Item.Cells[0].FindControl("modifyGIF")).Attributes.Add("onclick", "window.open ('ywxx_fp.aspx?Entp_ID=<%#DataBinder.Eval(Container.DataItem,"Entp_ID"', 'win19','width=700,height=570 ,top=200,left=120');");
}
}
解决方案 »
- 老师给的一个ASP.NET的源程序,带数据库的,不会运行。求教我怎么运行~
- easyui 不识别json
- 未将对象引用设置到对象的实例
- GridView一行显示相同多列
- asp.net中javaScript
- 各位大侠.进来帮帮我阿~ 关于Datatable取值问题.
- .NET里的TREEVIEW.HTC可以在非.NET环境下使用吗?
- asp.net(C#)批量更新问题
- 在asp.net后台代码中怎样调用在.aspx定义的javascript函数?
- 急送分!panel控件问题,在线等待?
- DropDownList --js问题
- 用编辑器后一个涉及安全的问题,怎么解决?请大家帮忙。。。~~~~~~~~~~~~~~~~~~~~~
附个人网站,http://www.jgking.cn 欢迎光临
{
string Entp_ID=this.DataGrid1.DataKeys[i].ToString();
if (e.Item.ItemType == ListItemType.Item ¦ ¦ e.Item.ItemType == ListItemType.AlternatingItem)
{
((ImageButton)e.Item.Cells[0].FindControl("modifyGIF")).Attributes.Add("onclick", "window.open ('ywxx_fp.aspx?Entp_ID= "+ Entp_ID +"', 'win19','width=700,height=570 ,top=200,left=120');");
}
}就ok了
<asp:BoundColumn Visible="False" DataField="Entp_ID" ReadOnly="True"></asp:BoundColumn>
<asp:TemplateColumn>
<ItemTemplate>
<asp:TextBox ID="entp_ID" runat="Server" Text='<%# DataBinder.Eval(Container.DataItem,"Entp_ID")%>'
Visible="false"></asp:TextBox></ItemTemplate>
</asp:TemplateColumn>
然后,在代码这样写:string tempString = ((TextBox)e.Item.Cells[0].FindControl("entp_ID")).Text.ToString();