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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top