NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Niels Larsen on May 26, 2009, 11:47:39 PM

Title: Call static page if connection error
Post by: Niels Larsen on May 26, 2009, 11:47:39 PM
Hi

I'm working with an app, connecting to several sql databases - selected through an id when the user call my site. But if the user forget og enter a bad id I want a static page to be displayed.
Where is the best place to put this call.

My connectionstring initiats in the webhandler - processlink.

Best regards
Niels Larsen
Title: Re: Call static page if connection error
Post by: Bruce on May 27, 2009, 08:02:22 AM
So, you want to override the default error page? Is that what you have in mind?

cheers
Bruce
Title: Re: Call static page if connection error
Post by: Niels Larsen on May 27, 2009, 09:31:21 AM
I would like to give my users a page with all the valid links.
Title: Re: Call static page if connection error
Post by: Bruce on May 28, 2009, 10:14:53 PM
Hi Niels,

I've not had a chance to test this, but here's the theory.

a) you're making the connection early - in ProcessLink before parent call. Good.

By this stage the page "about to be served" is stored in 2 properties.
    self.RequestFileName and
    self.pagename

the one includes the path, the other not. ie
self.pagename = self.GetPageName(Self.RequestFileName)

So you can change the contents of self.RequestFileName
then call
self.pagename = self.GetPageName(Self.RequestFileName)

self.RequestFileName as I said contains the path and the filename.
So if you have an alternate procedure name, or static htm file, then use the
web folder path. eg

self.RequestFileName = clip(self.site.WebFolderPath) & '\heydude.htm'
self.pagename = self.GetPageName(Self.RequestFileName)

Cheers
Bruce
Title: Re: Call static page if connection error
Post by: Niels Larsen on May 31, 2009, 09:27:31 PM
Hi Bruce

It works - great!
Thanks.

/Niels