Dozens of my webforms use the same masterpage. My master page has a label. This label ought to be invisible on ONE of the webforms.
If I write anything about this label in my webform, VS freaks out because the label is not on the webform. So I need to write my code in the master page.
I am considering a couple of different solutions to this problem:
1. In my master page, could I write something like "If you are applied to webform1, hide labela"? Can you get me started on the syntax for that?
2. I have a treeview on my masterpage. Identifying the selected node would tell me which web form is instantiated. I tried Response.Write(TreeView1.SelectedNode.Text). Unfortunately I get an error stating that TreeView1 has not been instantiated. This happens whether I use the page_load event or the Page_PreRender event. How could I overcome this chicken-egg problem??
I look forward to your feedback on solutions one and two.
If I write anything about this label in my webform, VS freaks out because the label is not on the webform. So I need to write my code in the master page.
I am considering a couple of different solutions to this problem:
1. In my master page, could I write something like "If you are applied to webform1, hide labela"? Can you get me started on the syntax for that?
2. I have a treeview on my masterpage. Identifying the selected node would tell me which web form is instantiated. I tried Response.Write(TreeView1.SelectedNode.Text). Unfortunately I get an error stating that TreeView1 has not been instantiated. This happens whether I use the page_load event or the Page_PreRender event. How could I overcome this chicken-egg problem??
I look forward to your feedback on solutions one and two.