I’m currently learning to use MasterPages and ContentPlaceHolders in ASP.NET 3.5 and C# – and right now, I’m desperately trying to edit the contents of an asp:Content-Control through my programming code.
Background is this; As soon as a Button is pressed, I want the asp:Content to be cleared and filled with dynamic generated content through the *.cs-File.
But I can’t figure out how to access the asp:Content-Control, neither through its ID or Page.FindControl etc.
So, how can you edit the contents of a asp:Content-Control through your programming code?
You can access a ContentPlaceholder by using FindControl not on the page object, but on its master page.
I’d agree though that it’s better to define a panel or placeholder within this block and access that directly, rather than try to modify the ContentPlaceholder