How to pass parameters to Web Browser Application?

Hi,

Is it possible to to pass parameters to web browser application Something like:

http://localhost/Test.wba ClientId=12345

Thanks

 



Answer this question

How to pass parameters to Web Browser Application?

  • BJBarry

    Thanks, Valentin. I'd also like to add a couple points: a) you need to include System.Deployment.dll as reference in your project, which I'm pretty sure you've done, and b) this feature does not work within an IDE like Visual Studio.

    The reason for b) is that when we launch the application in Visual Studio, we don't really use the ClickOnce deployment mechanism to launch it. This is so the app is not instituted into the ClickOnce app store. Among other things, this saves you from having to constantly bump up the version number whenever you make changes and hit F5 or Ctrl-F5. Now, if you launch the application via a Uri, you will see the ActivationUri is valid and that it exposes the URL parameters.



  • treidel

    Yes it is possible.

    Within the web browser application, you can use System.Deployment.Application.ApplicationDeployment.CurrentDeployment.ActivationUri to get to the Uri and pull the request parameters from it.

    Regards,

    Ashish Shetty
    Program Manager, Windows Presentation Foundation
    http://nerddawg.blogspot.com

     



  • A-Ka

    Any Ideas
  • kazor

    One other note:

    You need to select the "Allow URL parameters to be passed to application" option in your project properties. In VS, it can be found on the Publisher tab under the Options button.


  • Bdy

    Thank you all. I really appreciate your answers.
  • BubbleGum

    Thanks, that was helpful.
  • JimMace

    1. Yes, the extension and MIME type have changed in Dec CTP - so don't forget to setup the MIME type for your local server.

    2. What error do you get

    3. I think it's OK to call ApplicationDeployment.CurrentDeployment.ActivationUri in the Loaded event. Again, what error do you get

    I have used this feature in one of my projects and it's working.


  • Glen Bartlett

    Hi Ashish,

    I found couple of problems in trying to implement this feature.

    1. I created a simple Web Browser Application using the latest CTP. I created this project using Orcas, VS2005 extentions to WInFx. When I build the project, I didn't see a .wba file in BIN folder. Instead there was a XBAP file. Is this changed with Dec 2005 CTP

    2. When I try to pass parameters like http://localhost/test.xbap ClientId=123, It was giving an error.

    3. When I try to call System.Deployment.Application.ApplicationDeployment.CurrentDeployment.ActivationUri, I wa getting a runtime error Where do I call this inside my web browser application What would be the current deployment, when I am debugging the application within the VS2005


  • How to pass parameters to Web Browser Application?