在我的应用程序中找到一个面板,我从数据库中获取面板ID和网页我需要找到面板与该ID我需要使其可见虚假。 代码后面是在面板编号为
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Try
Dim kioskxml As String = "pnlfindid"
Dim myControl1 As Control = Page.FindControl(kioskxml)
If (Not myControl1 Is Nothing) Then
myControl1.Visible = False
End If
Catch ex As Exception
End Try
End Sub
但通过上面的代码片段,我无法获取面板,但它正常工作与像文本框和其他控制。 我需要一种方法来找到ID为面板上的页面加载
我的HTML页面
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</ajaxToolkit:ToolkitScriptManager>
<div onload="disableBackButton();">
<table align="center" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td>
<asp:Panel ID="pnlfindId" runat="server">
<table align="center" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td>
<asp:Panel ID="pane3" runat="server">
</asp:Panel>
</td>
</tr>
</table>
</asp:Panel>
</td>
</tr>
</table>
</asp:Content>
感谢
确保页面中存在“pannelID”。 – 2014-10-08 04:53:03
ya panelId在页面中仍然存在mycontrol在上下文中没有任何内容 – 2014-10-08 04:54:28
@AravindGoud是否动态生成此面板? – Tushar 2014-10-08 05:04:14