开发者

Passing parameters to .NET ClickOnce-deployed application from Flex without URL being visible

开发者 https://www.devze.com 2023-01-05 15:55 出处:网络
I\'m passing parameters to a .NET ClickOnce-deployed application via the URL from a Flex application. This is done by simply redirecting the user to http://myDomain/myApplication.application?a=1.

I'm passing parameters to a .NET ClickOnce-deployed application via the URL from a Flex application. This is done by simply redirecting the user to http://myDomain/myApplication.application?a=1.

I would like the URL to not be visible in the browser that links to the application. From what I understand, ClickOnce does not work with POST, so that option's out. .NET folks, is there another option? From ASP.NET, I could have done a simple Server.Transfer to the launching URL.

From a Flex application, I don't know what options I have. NavigateToURL will make the URL visible in the browser. Opening a tiny window with that address will still leave it visible for a second or two.

I tried using an mx:Httpservice component to make a request to that URL, but that didn't work. I'm not sure why. I tried using both the following:

<mx:HTTPService id="launcherService" 
                    url="http://myDomain/myApplication.application?a=1">
    var parameters:Object = new Object();
    launcherService.send();

and

<mx:HTTPService id="launcherService" 
                    url="http://myDomain/myApplication.application">  

var parameters:Object = new Object();
    parameters.a = 1;
    launcherService.send(parameters);

I used HTTPWatch and I can see 开发者_Python百科that the HTTP request was made. But the application wasn't deployed. I don't know why. Is there a solution?


HTTPService is for fetching a url and parsing the retrieved data within the flex application itself. navigateToUrl is the normal way to go if you're trying to redirect the user to a URL, but you cannot hide the address bar of the target window with it. To hide the address bar, you need to use javascript. Use ExternalInterface to call javascript from your Flex application. The catch is that the pop-up blocker might prevent the pop-up from displaying - you'd have to ask user to allow pop-ups from your site.

Try calling

ExternalInterface.call("window.open('" + url + "', '_blank', 'menubar=0,location=0,toolbar=0'"));
0

精彩评论

暂无评论...
验证码 换一张
取 消