G
Guest
I have a .aspx site.
I have a header that I want on the entire site. So I made it a User Control
..ascx file. In this header, I make one SQL call, so I need to create all the
connection objects, etc.
So I embed that User Control in the .ascx file. No problem.
The problem is I have to make another SQL call in the .aspx file. But it
appears that I can not use the same connection object that I declared in the
..ascx file.
I do not want to create multiple connection object for each page.
Is there a proper way to do this considering the requirements? Maybe use a
code-behind. I only want to create one connection object per page.
I have a header that I want on the entire site. So I made it a User Control
..ascx file. In this header, I make one SQL call, so I need to create all the
connection objects, etc.
So I embed that User Control in the .ascx file. No problem.
The problem is I have to make another SQL call in the .aspx file. But it
appears that I can not use the same connection object that I declared in the
..ascx file.
I do not want to create multiple connection object for each page.
Is there a proper way to do this considering the requirements? Maybe use a
code-behind. I only want to create one connection object per page.