My case:
– My application is called (https://myaddress/?p1=2&p2=aaa
Please help me to get the code transmitted on the callback
Hi Adrian,
please use Application.Uri it should contain the full query string that you can then parse.
Best regards
Frank
the event handlers are ok.
To reproduce the problem (because you cannot simulate the API I call): Try a new project with an empty form and add just add in Main
Application.ApplicationRefresh += Application_ApplicationRefresh
and
private static void Application_ApplicationRefresh(object sender, EventArgs e)
{
MessageBox.Show(“Application_ApplicationRefresh:\n” + Application.Url);
}
Next, with the application running, go to address bar in the browser and add to it /?code=13 to existing address and hit enter.
You will see that the event triggers, but in Application.Url there is no code=13.
What is the problem that persists?
You can attach event handlers. I don’t know what overwriting an event means.
All the parameters are all available in Url, Uri, StartupUrl, StartupUri and QueryString. See api docs for Application properties.
If you still need more details attach a small runnable fully contained project that shows what you are trying to do.
I tried with both events, just Application.ApplicationRefresh is called, but as I told you, the Application.Url does not contains the code. See attached printscreen.
The code is:
private static void Application_ApplicationRefresh(object sender, EventArgs e)
{
Log(“Application_ApplicationRefresh:” + Application.Url);
MessageBox.Show(“Application_ApplicationRefresh:\n” + Application.Url);
}
Hi Adrian,
I don’t think I fully understood what you want to achieve.
Do you want to persist the parameters p1 and p2 that you receive when your application is launched?
If yes, just store them into your session.
For ApplicationRefresh and ApplicationHashChanged, they are regular .NET events and you can subscribe to them
like you would for any other event.
Best regards
Frank
Hi Frank, thank you for answering.
Now I detect that change in Page.Appear event, not very elegant, but it’s called. Problem is that Application.Url replace the part I need. Instead of “https://myaddress/?code=somecode” (that can be seen on browser address) I get https://myaddress/?_sc=something. I presume that Wisej replaces real parameters with that _sc, probably to retrieve my session. So, up until now, the single point where I can get the real parameters from calling http is on Program.Main.
So the problem persists.
As a bonus, please instruct me how to overwrite events ApplicationRefresh or ApplicationHashChanged.
Hi Adrian,
you might want to check out the events ApplicationRefresh or ApplicationHashChanged and query the Application.Url property.
Best regards
Frank
Please login first to submit.