此代码中有什么错误
我在gridview中有一个Imagebutton2,其命令名为xxx,我添加了带有ImageButton2的modalpopup extendar panel2,我希望当单击图像按钮2时,modalpopup将显示并从选定的gridview行中检索值到面板的literal3控件1作为gridview的modalpopup控件?
Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles GridView1.RowCommand
Dim myrow As GridViewRow = CType(CType(e.CommandSource, Control).NamingContainer, GridViewRow)
Dim index As Integer = Convert.ToInt32(e.CommandArgument)
If e.CommandName = "xxx" Then
Dim lab5 As Label = DirectCast(myrow.FindControl("Label5"), Label)
Dim lit3 As Literal = Me.Panel2.FindControl("Literal3")
lit3.Text = lab5.Text
End If
End Sub
答案 0 :(得分:1)
很多事情都可能失败: