NetTalk Central

Author Topic: Call static page if connection error  (Read 4394 times)

Niels Larsen

  • Sr. Member
  • ****
  • Posts: 431
    • View Profile
    • Email
Call static page if connection error
« 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

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Call static page if connection error
« Reply #1 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

Niels Larsen

  • Sr. Member
  • ****
  • Posts: 431
    • View Profile
    • Email
Re: Call static page if connection error
« Reply #2 on: May 27, 2009, 09:31:21 AM »
I would like to give my users a page with all the valid links.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Call static page if connection error
« Reply #3 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

Niels Larsen

  • Sr. Member
  • ****
  • Posts: 431
    • View Profile
    • Email
Re: Call static page if connection error
« Reply #4 on: May 31, 2009, 09:27:31 PM »
Hi Bruce

It works - great!
Thanks.

/Niels