Hi,
I'm using the followin basic ASP.NET:
<%@ Register TagPrefix="Test" Namespace="Test.Controls" Assembly="Test.Controls" %>
<html>
<body>
<Test:ContentBox id="Content" runat=server/>
</body>
</html>
The Custom Control simply opens an XML file loads some data and then renders itself depending upon the data. It works fine and I love it as it's nice and clean in the aspx file as you can see.
I want to now add another control in that controls the title of the page:
<%@ Register TagPrefix="Test" Namespace="Test.Controls" Assembly="Test.Controls" %>
<html>
<head>
<title><Test:TitleBox id="Title" runat=server/></title>
</head>
<body>
<Test:ContentBox id="Content" runat=server/>
</body>
</html>
The problem I have now, is that I'm opening and parsing the XML file twice, and I have another idea of where else I want to use the data on the page, so it'll be opened three times.
Is there an easy way to share the data between the Controls once I've parsed it from the XML file, without having to resort to adding a Page_Load event to do the legwork?
I really like the fact that my page doesn't have a code behind file or any code within it, just a few components and I'd like to keep it that clean and simple.
Littlecharva
"Test" Namespace=
"Test.Controls" Assembly=
"Test.Controls" %>