Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP General (http://www.velocityreviews.com/forums/f65-asp-general.html)
-   -   Determining URL in Application_OnStart (http://www.velocityreviews.com/forums/t794552-determining-url-in-application_onstart.html)

David Logan 05-21-2004 06:01 AM

Determining URL in Application_OnStart
 
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

Bob Lehmann 05-21-2004 12:31 PM

Re: Determining URL in Application_OnStart
 
Request.ServerVariables("Server_Name")

Bob Lehmann

"David Logan" <ibflyfishin@yahoo.com> wrote in message
news:d3af388a.0405202201.4549edde@posting.google.c om...
> 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




David Logan 05-21-2004 05:54 PM

Re: Determining URL in Application_OnStart
 
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

"Bob Lehmann" <nospam@dontbotherme.zzz> wrote in message news:<u4od$#yPEHA.3988@tk2msftngp13.phx.gbl>...
> Request.ServerVariables("Server_Name")
>
> Bob Lehmann
>
> "David Logan" <ibflyfishin@yahoo.com> wrote in message
> news:d3af388a.0405202201.4549edde@posting.google.c om...
> > 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


Bob Lehmann 05-21-2004 08:17 PM

Re: Determining URL in Application_OnStart
 
Any reason not to do it in Session Start?

Bob Lehmann


"David Logan" <ibflyfishin@yahoo.com> wrote in message
news:d3af388a.0405210954.10efe66@posting.google.co m...
> 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
>
> "Bob Lehmann" <nospam@dontbotherme.zzz> wrote in message

news:<u4od$#yPEHA.3988@tk2msftngp13.phx.gbl>...
> > Request.ServerVariables("Server_Name")
> >
> > Bob Lehmann
> >
> > "David Logan" <ibflyfishin@yahoo.com> wrote in message
> > news:d3af388a.0405202201.4549edde@posting.google.c om...
> > > 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




Bob Barrows [MVP] 05-21-2004 08:26 PM

Re: Determining URL in Application_OnStart
 
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
David Logan wrote:
> 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
>
> "Bob Lehmann" <nospam@dontbotherme.zzz> wrote in message
> news:<u4od$#yPEHA.3988@tk2msftngp13.phx.gbl>...
>> Request.ServerVariables("Server_Name")
>>
>> Bob Lehmann
>>
>> "David Logan" <ibflyfishin@yahoo.com> wrote in message
>> news:d3af388a.0405202201.4549edde@posting.google.c om...
>>> 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


--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"




All times are GMT. The time now is 02:03 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.