【问题标题】:Open popup by imagebutton click on GridView通过imagebutton打开弹出窗口单击GridView
【发布时间】:2011-10-21 11:10:39
【问题描述】:

我有两列的 GridView(id: gv_test):

项目编号

ImageButton (id: ImageBTN)

<asp:ImageButton ID="ImageBTN" Width="34px" Height="34px" ImageUrl="~/bla/bla.png" OnClick="ImageBTN_Click"  runat="server" CommandName="Select" Text="PopUp"> </asp:ImageButton> 

如您所见,我通过使用 CommandName 尝试使用 OnRowCommand 和 OnRowDataBound 进行某些操作。但没有成功,甚至没有关闭。

itemId 从 sql 表中获取他的值。

我想要做什么 - 当用户点击 ImageButton 时 - 将打开一个带有链接的弹出窗口:test.aspx?id=itemId。

我如何通过 c#(OnClick 事件)来做到这一点。

【问题讨论】:

    标签: c# asp.net sql gridview


    【解决方案1】:

    这应该会有所帮助。我做了类似的事情,这段代码很有帮助。

    http://www.codeproject.com/KB/webforms/gridview_popup.aspx

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-02-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-10-31
      • 2020-06-03
      • 1970-01-01
      • 2018-12-18
      相关资源
      最近更新 更多