I have a simple (text) data file that I need to load "On Page Load". The HTML section of the page will then display some of the data that is read in. (By the way, I'm using vb with asp.net 1.1 and I'm writing everything in notepad -- I don't use code-behind or Visual Web Developer.)
However, I need to use that same code into hundreds of pages. If I want to change the code, I want to be able to update a single file -- not hundreds of them. I tried putting the code (which sits between <script runat"server"> and </script> tags) into a User Control -- but it does NOT work. From what I've read, user controls are run/rendered too late in the process -- so user control code in a "Sub Page_Load" does not get run.
In addition, I don't want the raw code to be visible/included in the pages. In the past, I've had web designers accidentially change code in some pages and I want to prevent that.
I have a test page done and it works perfectly (as long as the code is hard-coded and saved inside the page). This seems like it would be a VERY common problem -- a simple include or user control SHOULD work, but it doesn't. I've spend hours searching the web and still cannot find an answer.
Can anyone offer a solution?
Johnny