简体   繁体   English

在Page_Load中隐藏控件

[英]Hide control in Page_Load

I am using label control in form designing.But i want to hide that particular label control on page load. 我在表单设计中使用标签控件。但是我想在页面加载时隐藏该特定标签控件。

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
   Label10.Visible = False
End Sub

What should i do? 我该怎么办? I'm new to vb.net. 我是vb.net的新手。

Try setting the visibility property within the aspx code rather than within the load event, this may solve your issue. 尝试在aspx代码而不是在load事件中设置可见性属性,这可能会解决您的问题。

<asp:Label ID="lblValidation" runat="server" BackColor="Red" 
                    Text="Please fill in all of the date fields below to proceed" Visible="False"></asp:Label>

Hope this helps! 希望这可以帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM