user control caching



I am caching a user control for an hour, based on a certain property. When
the page first loads the page is cached just fine. However, whenever I close
the browser screen and then go back into it I get the following error:
Object reference not set to an instance of an object. Does anyone have any

The cache directive in the .aspx page:
<%@ OutputCache Duration="3600" VaryByControl="Category" VaryByParam="*" %>

Properties set of the control in the .aspx page:

' The error: "Object reference not set to an instance of an object."
occurs in the first line below.
ctrlEditScreen.Category = category
ctrlEditScreen.FieldDefinitionsDatasource = MyDatasource
ctrlEditScreen.UserName = MyName

Any help is greatly appreciated!


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question