C
codeWarrior
I'm having trouble working with web controls from the C# code behind file. Some controls are accessible to me programatically, and some are not
For example, I trying to hide, or display an <asp:Table> on post back on the page, here is my code
HTML
<asp:Table id="commentTable" runat="Server"><asp:TableRow><asp:TableCell>Some Text</asp:TableCell></asp:TableRow></asp:Table
C# Code Behin
protected System.Web.UI.WebControls.Table commentTable
private void Page_Load(object sender, System.EventArgs e
commentTable.Visible = isPostBack
I get this error anytime I run the app
Object reference not set to an instance of an object.
Description: 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 object
Source Error:
Line 37: commentTable.Visible = isPostBack
If you have experienced a similiar problem, please help
For example, I trying to hide, or display an <asp:Table> on post back on the page, here is my code
HTML
<asp:Table id="commentTable" runat="Server"><asp:TableRow><asp:TableCell>Some Text</asp:TableCell></asp:TableRow></asp:Table
C# Code Behin
protected System.Web.UI.WebControls.Table commentTable
private void Page_Load(object sender, System.EventArgs e
commentTable.Visible = isPostBack
I get this error anytime I run the app
Object reference not set to an instance of an object.
Description: 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 object
Source Error:
Line 37: commentTable.Visible = isPostBack
If you have experienced a similiar problem, please help