View Single Post
Old Sep 23rd, 2007, 5:17 PM   #1
paulchwd
Hobbyist Programmer
 
paulchwd's Avatar
 
Join Date: Mar 2005
Posts: 139
Rep Power: 4 paulchwd is on a distinguished road
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";
        }
}
paulchwd is offline   Reply With Quote