Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="ucTabCtrl" >
- <uc1:TLTabControl ID="ctrlname" runat="server" Visible="False" />
- </div>
- Master Page_load()
- {
- // checking some condition if true
- ctrlname.visible = true;
- }
- public partial class Site1 : System.Web.UI.MasterPage
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- if (Page is WebForm1 || Page is WebForm2)
- {
- webUserControl11.Visible = false;
- }
- }
- }
- public partial class Site1 : System.Web.UI.MasterPage
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- ISpecialPage specialPage = Page as ISpecialPage;
- if (specialPage != null && specialPage.ShouldDisableUserControl)
- webUserControl11.Visible = false;
- }
- }
- public interface ISpecialPage
- {
- bool ShouldDisableUserControl { get; }
- }
- if (null != this.Master)
- {
- userControl.Enabled = false;
- }
- Dim userControl As WebControl = ContentPlaceHolder1.FindControl("someControl")
- If userControl IsNot Nothing Then
- CType(userControl, WebControl).Enabled = False
- End If
Add Comment
Please, Sign In to add comment