I’m a web designer so I rarely get my hands dirty in .NET code. I’m doing a bit of light coding repurposing some code from one area of a site for another. How to target elements in a master? I have the following in a page that is calling a master that contains lblError and pnlError…
public void AddError(string error)
{
if (error != "")
{
lblError.Text = error;
pnlError.Visible = true;
}
}
I’m getting an error that says the items do not exist in the current context. How to I tell it to look for the elements within the master?
So I don’t know if it is the cleanest way to do it, but the following worked for me…