Skip to content

URL arguments #388

Closed
Closed

Description

@itg-assistant

Rui Oliveira asked 2016-11-15 15:25:01 UTC

How to pass arguments variables in the application URL?

In VWG we have something like this:

../Post.Mainform.wgx?Name=Aaa&Pwd=xpto

And how we get them in code side?

Thanks & regards,

Rui

Activity

  1. itg-assistant commented on Jun 12, 2026

    @itg-assistant
    Author

    Luca answered 2016-11-15 15:28:58 UTC

    Hi Rui,

    In two ways:

    Best,

    Luca

  2. itg-assistant commented on Jun 12, 2026

    @itg-assistant
    Author

    Rui Oliveira answered 2016-11-15 15:37:28 UTC

    Is necessary use the “Post” string in URL too?

    Thanks & Regards,

    Rui

  3. itg-assistant commented on Jun 12, 2026

    @itg-assistant
    Author

    Luca answered 2016-11-15 15:46:03 UTC

    No, Wisej pages are standard html, aspx, mvc, or anything else that the browser can load.

    http://localhost/myapp

    http://localhost/myapp/default.html

    http://localhost/myapp?arg=1

    http://localhost/myapp/default.html?arg=1

    All work.

  4. itg-assistant commented on Jun 12, 2026

    @itg-assistant
    Author

    Sebastián Serrisuela answered 2016-12-01 16:41:56 UTC

    I still can not get the URL parameters.
    Application.QueryString always returns 0.
    Do I enter the parameters in the URL?

  5. itg-assistant commented on Jun 12, 2026

    @itg-assistant
    Author

    Luca answered 2016-12-01 18:46:01 UTC

    Hi Sebastian, the arguments go after the URL:

    http://localhost/myapp?arg1=hello

    In your code you will find the startup arguments in Program.Main(NameValueCollection args) and always in Application.QueryString (which uses the same collection as HttpContext.QueryString).

    AlertBox.Show(Application.QueryString["arg1"]);

    Best,
    Luca

  6. itg-assistant commented on Jun 12, 2026

    @itg-assistant
    Author

    Sebastián Serrisuela answered 2016-12-02 12:33:56 UTC

    I still can not get the URL arguments.
    This is my URL: http://localhost:4988/Quirofano?sid=15

    My JSON: “startup”: “Quirofano.Program.Main, Quirofano”

    Is there any configuration in the project?

  7. itg-assistant commented on Jun 12, 2026

    @itg-assistant
    Author

    Frank (ITG) answered 2016-12-02 13:14:15 UTC

    Hi Sebastian, sid and lang cannot be used for that purpose. Those 2 are reserved for Wisej.
    Hope that helps, Frank.

  8. itg-assistant commented on Jun 12, 2026

    @itg-assistant
    Author

    Sebastián Serrisuela answered 2016-12-02 13:28:02 UTC

    Thank you! I already take the argument.

    Now, if I change the value of the argument in the URL, it does not take the change. You need a POST (like VWG)

  9. itg-assistant commented on Jun 12, 2026

    @itg-assistant
    Author

    Frank (ITG) answered 2016-12-02 16:03:48 UTC

    Hi Sebastian,

    I have setup a small sample that shows to extract the URL parameters:

    Download the sample here

    Hope that helps.

    Best regards
    Frank

  10. itg-assistant commented on Jun 12, 2026

    @itg-assistant
    Author

    Sebastián Serrisuela answered 2016-12-02 17:03:24 UTC

    Thank you! It was very useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    GeneralQuestions, how-tos and everything else.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions