Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   ASP.NET (http://www.programmingforums.org/forum35.html)
-   -   Null Reference Expeption... why? (http://www.programmingforums.org/showthread.php?t=14029)

paulchwd Sep 23rd, 2007 5:17 PM

Null Reference Expeption... why?
 
Hi All,

I have a label on my aspx page and when I try to set the .Text property of if from the code behind file I get a null reference expeption....

Code behind file for form1
:

catch (MySqlException mysqlx)
            {//<catch>
                showError show = new showError();
                show.printError(mysqlx.Message.ToString(), mysqlx.StackTrace.ToString());
            }//</catch>


Code behind file for form2
:

public partial class showError : System.Web.UI.Page
    {
        public void printError(string error, string trace)
        {
          Label2.Text = "xx";
        }
}


xavier Sep 23rd, 2007 11:16 PM

How does your aspx look like ?


All times are GMT -5. The time now is 10:27 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC