Page_Load automation

  • Thread starter Thread starter Random
  • Start date Start date
R

Random

I am wanting to set the innerText of an html element during the Page_Load
event. I know how to do this by using runat="server" and everything. The
difference is that since I want this same operation to happen on every page,
using data stored in the web.config file.

How can I get this operation to run without having to explicitly put the
code into the Page_Load event for every code_behind page?
 
Two options I can think of.

1. Write a UserControl that does this for you and place it on every page.
2. Derive your own page class from System.Web.UI.Page and then derive each
of your own pages from your custom page.

There might be more, but those are the two approaches I would do.

bill
 
Back
Top