NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: CaseyR on December 12, 2021, 12:30:03 PM

Title: Conditionally refer to another page.
Post by: CaseyR on December 12, 2021, 12:30:03 PM
Hi, all

I am a bit embarrassed to ask this because I am sure it is simple and documented even if I can't find it.

Users call a memory form from a menu;
the memory form is primed from intersession values;
if one of those values is set to TRUE the user should be referred to another page automatically;
if not the form is display to collect user input.

How do I do the automatic referral?

Thanks.   
Title: Re: Conditionally refer to another page.
Post by: Bruce on December 12, 2021, 11:00:09 PM
so, it's possible to trigger a redirect, (and I'll get to that) but first I want you to step back and consider your flow here.
Redirects are "slower" than just going to the right place, because instead of 1 request, 1 response, you end up with 2 requests and 2 responses.

So rather than a Redirect, I'd suggest looking at 2 things;
a) could the menu item be better constructed to go to the right place directly. Perhaps using 2 menu items with the same text, but with opposite include conditions? then the menu is ready to take the user to the right place.

b) could the destination form be better done to include both pathways - again with perhaps multiple tabs with conditions. Or a wizard form that can skip straight to tab 2 etc.

Assuming you can't make a better flow, you can do a redirect using

p_web.Redirect('someurl')
in the form - perhaps in the GenerateForm routine.

Cheers
Bruce
Title: Re: Conditionally refer to another page.
Post by: CaseyR on December 13, 2021, 05:43:38 PM
Thanks, Bruce

The menu item is a good idea that I hadn't considered.