Hi,This code works:<div id="GridDiv" runat="server"> gridview would go in here.... </div>GridDiv.Visible=false;However, because I have a Div in LoginView2 I have to find with findcontrol.This is not work: LoginView Div = LoginView2.FindControl("GridDiv") as LoginView; Div.Visible = false;
Object reference not set to an instance of an object.
An unhandled exception occurred during the execution of the current web
request. Please review the stack trace for more information about the error and
where it originated in the code. Exception Details:
System.NullReferenceException: Object reference not set to an instance of an
Line 787: Div.Visible = false;
Thanks for your help!
View Complete Post