Hi all,
I've got a FormView control with a few empty TextBoxes, among others one for name and email. Is it possible to fill these in with values retrieved from Cookies? All I get is "Object reference not set to an instance of an object".
Does anybody know how to do this?
Thanks, Peter
I've got a FormView control with a few empty TextBoxes, among others one for name and email. Is it possible to fill these in with values retrieved from Cookies? All I get is "Object reference not set to an instance of an object".
Code:
protected void FormView1_DataBound(object sender, System.EventArgs e)
{
DataRowView row = (DataRowView)FormView1.DataItem;
if (row["Reply"] == DBNull.Value)
{
FormView1.ChangeMode(FormViewMode.Edit);
Trace.Write("changemode");
// Error: Object reference not set to an instance of an object
((TextBox)FormView1.FindControl("RepliedBy")).Text = Request.Cookies["Name"].Value;
}
else
FormView1.ChangeMode(FormViewMode.ReadOnly);
}
Does anybody know how to do this?
Thanks, Peter