D
Dave
I am having a hell of a time getting this working. I have a huge aspx page
that is using a tab control and a multipage control. To make things easy on
myself I decided to have each tab be a separate Web User Control. When the
page loads, the user controls show up in the correct tabs, but I can't access
the data. I want to be able to populate a bunch of text boxes and labels
with data that I pull from a SQL db. I first tried to set the members as
public static, but that throws a runtime error in a hidden line. Now I am
exposing the members in the standard way with:
public string expTxtFirstName
{
set
{
txtFirstName.Text = value;
}
get
{
return txtFirstName.Text;
}
}
This is also throwing a runtime error saying Object reference not set to an
instance of an object for the first member it comes to (txtFirstName).
Here is the class & textbox declaration:
public class Customer : System.Web.UI.UserControl
{
protected internal System.Web.UI.WebControls.TextBox txtFirstName;
I even tried to have a function local to the Customer class that could set
those values, but it fails with the same error. I even tried making a new
ascx page and recreating the code there, but it does the same thing.
What am I screwing up?
Thanks
dave
that is using a tab control and a multipage control. To make things easy on
myself I decided to have each tab be a separate Web User Control. When the
page loads, the user controls show up in the correct tabs, but I can't access
the data. I want to be able to populate a bunch of text boxes and labels
with data that I pull from a SQL db. I first tried to set the members as
public static, but that throws a runtime error in a hidden line. Now I am
exposing the members in the standard way with:
public string expTxtFirstName
{
set
{
txtFirstName.Text = value;
}
get
{
return txtFirstName.Text;
}
}
This is also throwing a runtime error saying Object reference not set to an
instance of an object for the first member it comes to (txtFirstName).
Here is the class & textbox declaration:
public class Customer : System.Web.UI.UserControl
{
protected internal System.Web.UI.WebControls.TextBox txtFirstName;
I even tried to have a function local to the Customer class that could set
those values, but it fails with the same error. I even tried making a new
ascx page and recreating the code there, but it does the same thing.
What am I screwing up?
Thanks
dave