1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

C#/ASP Web App Object Reference Error HELP

Discussion in 'Programming' started by MBlock, Aug 28, 2007.

Thread Status:
Not open for further replies.
  1. MBlock

    MBlock New Member

    Joined:
    Aug 28, 2007
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    I need some help troubleshooting this error message I am getting. First some real fast background. I am developing a web application that has an ASP.NET front end with C# code behind and a SQL database interface on the backend. That being said first some information about the ASP label in question:

    In my HTML I have a table with categories and databound elements. I need one of the category labels in one row to change dynamically dependent upon a value set in a radio button list. That value is stored in another database. First here is the HTML for the table:
    Code:
    <TABLE cellSpacing="1" cellPadding="2" width="98%" bgColor="#000000" border="0">
    																	<TR>
    <TD bgColor="#000066" colSpan="2"><SPAN class="Table">Funds Distribution</SPAN></TD>
    </TR>
    
    <TR>
    <TD align="left" bgColor="#ffffff">
    <asp:Label ID="TESTTEST" CssClass="text" Visible="True" Runat="server">BLAH</asp:Label>
    
    <asp:Label id="lblDebitView" CssClass="text" Visible="False" Runat="server">Debit Card</asp:Label>
    
    <asp:Label id="lblCashView" CssClass="text" Visible="False" Runat="server">Cash</asp:Label>
    
    <asp:Label id="lblCheckView" CssClass="text" Visible="False" Runat="server">Check</asp:Label>										</TD>
    
    <TD align="right" bgcolor="#ffffff">
    <span class="text"><%#  DataBinder.Eval(Container.DataItem, "DistroDesc") %> </span>
    <span class="text"><%#  DataBinder.Eval(Container.DataItem, "fundsAmnt") %> </span>
    </TD>
    </TR>
    																	<TR>
    <TD align="center" bgcolor="#ffffff" colSpan="2"><SPAN   Class="text"><B>Credible Wireless Note Date:<B><%#  DataBinder.Eval(Container.DataItem, "CW Date") %> </SPAN></TD></TR>
    </TABLE>
    
    Then I have the following definition in my C# code:

    protected System.Web.UI.WebControls.Label TESTTEST;

    and there are respective definitions for the other ASP labels written exactly the same, just with the respective variable name instead of TESTTEST.

    Finally, depending on the state of the aforementioned radio button I want to either make visible or hide those asp:labels above. The test was just a test but of the other three only one can be visible at a time. All I am calling in the C# code is this:

    this.TESTTEST.Visible = true;

    Again, respective for all other variables.

    And I get the following error message on ALL of the asp:labels (i.e. when one threw the error I commented it out and then it hit the next one ect.)

    The error message:
    Object reference not set to an instance of an object.

    The error source:
    clients2.0

    The error stack trace:
    at clients2._0.Financial.client_budgetForm.getUpdateInformation(Boolean isFuture) in \\devmachine\wwwroot$\project\financial\budgetform.aspx.cs:line 691
    at clients2._0.Financial.budgetForm.checkFutureBudgets() in \\devmachine\wwwroot$\project\financial\budgetform.aspx.cs:line 422
    at clients2._0.Financial.budgetForm.Page_Load(Object sender, EventArgs e) in \\devmachine\wwwroot$\project\financial\budgetform.aspx.cs:line 384


    exec usp_C0609View



    Last comment is line 691 of budgetform.aspx.cs is:

    this.TESTTEST.Visible = true;

    Line 422 of budgetform.aspx.cs. is just a FunctionY call to FunctionX of which inside is where line 691 is.

    Line 384 is a function call to the FunctionY


    PLEASE ANY help you may have or advice on where I can start looking to troubleshoot this would be great! I have been banging my head for hours trying to figure this out. I am hoping I am just overlooking something small and easy as I am a relative rookie in this flavor of programming. Thanks!
     
    Last edited by a moderator: Aug 28, 2007
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,283
    Likes Received:
    364
    Trophy Points:
    83
Thread Status:
Not open for further replies.

Share This Page