Problem with setting visibility of controls in child master page in asp.net?

EDIT: In this case, if the div is a top level element, and you are in the page_load of the child master page in which the div resides, you should just be able to do Div1. Visible = false Why not use a Panel control?

EDIT: In this case, if the div is a top level element, and you are in the page_load of the child master page in which the div resides, you should just be able to do Div1. Visible = false; Why not use a Panel control?

Yes there is a runat attribute – user653622 May 1 at 22:43 haven't you seen he has already included the attribute – PeachLabs May 1 at 22:57 @PeachLabs, he just included the markup. I'll delete my answer shortly. – Bala R May 1 at 22:58 no-offense bro – PeachLabs May 1 at 23:03 That worked like a charm.It took some time to work as I was doing a silly mistake from my side.

Thanks for your help and immediate feedback. Truly appreciate your endeavour – user653622 May 2 at 0:01.

Try setting @MasterType in Content Pages and in Child Master Pages. Below are some reference links msdn.microsoft.com/en-us/library/ms22827... http://dotnet.dzone.com/news/back-basics-%E2%80%93-using-mastertype?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+zones%2Fdotnet+%28.NET+Zone%29 dotnetslackers.com/community/blogs/haiss... Thanks.

– user653622 May 1 at 23:22 @user65 as I mention in the first line you can set the directive in Child MasterPages and Content Pages as well. – PeachLabs May 2 at 6:25.

Master page is loaded is after page_load. Therefore when you attempt to address the master page during page_load it's properties and methods are not yet available. Move this down in the page life cycle.ASP.NET Page Life cycle, Another SO answer on Masterpage/page life cycle.

The child master is loaded during the page_load, and parent master is loaded during the child master page_load.

You should say this.Master. FindControl("Div1"). Visible = false.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions