I have encountered this error "Object reference not set to an instance of an object." when i trying to set a value which i had session from the previous page and set it on a template field. when I debugged it, the session value was there(successfully session over). what i am trying to do is to display the value of what I had session on detailsview. aspx : \[code\] <aspetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False"> <Fields> <asp:TemplateField HeaderText="Order Number " SortExpression="poNum"> <ItemTemplate> <asp:Label ID="test" runat="server" Text='<%# Bind("poNum") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> </Fields> </aspetailsView>\[/code\]code behind : \[code\] protected void Page_Load(object sender, EventArgs e) { ((Label)DetailsView1.FindControl("test")).Text = Session["poNum"].ToString(); } \[/code\]I was wondering why I was unable to get the control from detailsview?? EDIT \[code\] Label aaa = new Label(); aaa.Text = Session["poNum"].ToString(); Label orderNum = (Label)DetailsView1.FindControl("test"); // orderNum was null here orderNum.Text = aaa.Text; \[/code\]