I have this class:
public class address
{
public string address1;
public string address2;
public string city;
}
Now whenever a page load I fill these values based on the session userid in parent user control,
on_load of parent page
{
connect to database;
get the info
address.address1 = "171, broadway";
}
now across the child user controls on this page I want to use these values…
address.address1 and so on without hitting database again, this is a sample data actual data is long enough to use session.
What is the best way of doing it?
Save the Data in the current session and call it every time you need
This will help Storing custom objects in Sessions
If Data is too big then just bind the data to all controls before “get the info”