Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problems using page.databind when outputting values from an object

Status
Not open for further replies.

mit99mh

Programmer
Sep 24, 2002
246
GB
I'm using a page with several panels - I instantiate an object and using Page.DataBind(); in the subroutine in the codebehind and <%# Object.Value %> in the apsx page - so far so good.

I then change the value in the object and use the same approach as above Page.DataBind(); in the subroutine in the codebehind and <%# Object.Value %> in a different panel the apsx page and I get System.NullReferenceException: and the error points to the line where I call Page.DataBind(); the second time.

I've worked around this now but I'm curious why I should get the error in the first place.

Any help much appreciated


 
Did you check for IsPostBack on the Page load event?

Hope everyone is having a great day!

Thanks - Jennifer
 
yes I don't do anything in it though

thanks for responding
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top