Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to using URL parameters within the same session
right now we know how to handle URL parameters when starting a new session. What we do is call a StartupSession method like shown below

procedure TWebRegistrationServerController.IWServerControllerBaseNewSession(
 ASession: TIWApplication);
 ASession.Data := TWebRegistrationSession.Create(nil, ASession);

Then in the .StartupSession method we look at the parameters and do something like


aValue := WebApplication.Request.QueryFields.Values[aFieldName];
if aValue = option1 then
else if aValue = option 2

Then, in the ServerController I set the FStartupForm to the main form

procedure TWebRegistrationServerController.IWServerControllerBaseGetMainForm(
   var vMainForm: TIWBaseForm);
 vMainForm := WebRegistrationSession.StartForm;

In that way, the URL controls which form the session starts with.

But what if the session is runnig, and the user pastes a URL in the browser and I want to show a form within that session based on the URL?

For example, I am making a simple CMS system based on TinyMCE, as wrapped by the CGDevTools components. If I want the user to be able to link to pages within the CMS I need to have a link that refers to a custom page within the CMS in the same session. So the link will be something like$/customPage="my page name"

So I need to be able to detect those links within a current session and then update the page that is being viewed to the page in the parameters. How can I do that?

Messages In This Thread
How to using URL parameters within the same session - by davenovo - 05-18-2018, 05:19 PM

Forum Jump:

Users browsing this thread: 3 Guest(s)