G
Guest
Hi,
I am trying to feed retained values from an object i created into some
textbox's. I get a Object Ref not set error. Plz take a look at the code:
I have this in my main class global section:
protected BLL.HoursEntry _userInput = new BLL.HoursEntry();
The following is in the Edit Command for a Datagrid:
_userInput.MonReg = Convert.ToDouble(((Label)
e.Item.FindControl("lbMon")).Text);
_userInput.MonOT = Convert.ToDouble(((Label)
e.Item.FindControl("lbMonOT")).Text);
((TextBox)e.Item.FindControl("tbMon")).Text =
Convert.ToString(_userInput.MonReg);
((TextBox)e.Item.FindControl("tbMonOT")).Text =
Convert.ToString(_userInput.MonOT);
I assume since when page gets loaded that user input object would get
created as well. I get no errors on the first two lines when assigning values
to userinput.
Only when I try to read value from userinput to textbox does it bomb. What
am I missing?
Thanks,
JJ
I am trying to feed retained values from an object i created into some
textbox's. I get a Object Ref not set error. Plz take a look at the code:
I have this in my main class global section:
protected BLL.HoursEntry _userInput = new BLL.HoursEntry();
The following is in the Edit Command for a Datagrid:
_userInput.MonReg = Convert.ToDouble(((Label)
e.Item.FindControl("lbMon")).Text);
_userInput.MonOT = Convert.ToDouble(((Label)
e.Item.FindControl("lbMonOT")).Text);
((TextBox)e.Item.FindControl("tbMon")).Text =
Convert.ToString(_userInput.MonReg);
((TextBox)e.Item.FindControl("tbMonOT")).Text =
Convert.ToString(_userInput.MonOT);
I assume since when page gets loaded that user input object would get
created as well. I get no errors on the first two lines when assigning values
to userinput.
Only when I try to read value from userinput to textbox does it bomb. What
am I missing?
Thanks,
JJ