Determining URL in Application_OnStart

D

David Logan

Hello,

I working on a project where we will be hosting several websites on
the same server. These websites are built of a similar template and I
want to use the URL as a key to get settings from the database. Is
there a way to programatically get the website url in the
application_onstart.

I know I could hard code it in but that leaves things open to user
error.

Thanks

David Logan
 
D

David Logan

Sorry Bob,

Thats where I started but it won't work. You don't have access to the
Request object in the Application_OnStartup. I'm looking to only have
to do this one time not every time a user starts a session.

Any other ideas?

Thanks
 
B

Bob Barrows [MVP]

You don't have to do it "every" time a user starts a session. Only the first
user. Use a variable in Application to indicate if the process was already
done. If not, get the url and do the process, ending by setting the variable
to indicate that the process is completed.

Bob Barrows
 

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

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top