如何在内容页面内的母版页内的更新面板中设置链接按钮的可见属性。
我在命令按钮的单击事件中没有运气
dim showLnk as Linkbutton =ctype(master.findcontrol("updatepanel1").findcontrol("lnkLogOut",LinkButton)
showLnk.visible =true.
答案 0 :(得分:0)
我们假设您在主页面中有此代码:
<asp:UpdatePanel ID="updatepanel1" runat="server">
<ContentTemplate>
<asp:Panel runat="server" ID="parentPanel">
<asp:LinkButton ID="lnkLogOut" runat="server">Logout</asp:LinkButton>
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
要设置内容页面的可见性,只需执行以下操作:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
Dim showLnk As LinkButton = Master.FindControl("lnkLogOut")
showLnk.Visible = False
End Sub