I am trying to launch a ClickOnce application via a link on a web page. The link has to go to the server to request a transaction GUID before it can launch the application. The code works like this:
function clickHandler() {
$.post('/gettransactionid.aspx', function(tranId) {
console.log("BEFORE");
window.location = "/deploy/Company.Domain.Product.application?" + tranId;
console.log("AFTER");
});
return false;
}
This works perfectly fine in Firefox but in IE it peforms a navigation and doesn't open the clickonce application. The console.log BEFORE and AFTER are shown in the console window in IE8 dev tools. Any help would be appreciated as I've spent 4 hours on this trying to solve it with various hacks!
I have tried:
Found the Answer in Microsoft's documentation:
If you have developed a custom Web page that launches a ClickOnce application using Active Scripting, you may find that the application will not launch on some machines. Internet Explorer contains a setting called Automatic prompting for file downloads, which affects this behavior. This setting is available on the Security Tab in its Options menu that affects this behavior. It is called Automatic prompting for file downloads, and it is listed underneath the Downloads category. The property is set to Enable by default for intranet Web pages, and to Disable by default for Internet Web pages. When this setting is set to Disable, any attempt to activate a ClickOnce application programmatically (for example, by assigning its URL to the document.location property) will be blocked. Under this circumstance, users can launch applications only through a user-initiated download, for example, by clicking a hyperlink set to the application's URL.
Update 1st September 2011: Ironically this has now broken entirely in IE9 thanks to "Automatic prompting for downloads" being removed.
Browsers that support web apps using Ajax:Microsoft Internet Explorer (IE) for Windows version 5.0 and above, with ActiveX enabled.
Just copy your code you used to open the modal by click, no ? What kind of "modal" window you want to open. Can you provide the code you use on click? "am able to open popup/modal box on a click of a button" success: function (returndata) { $("button").
AJAX success is a global event. Global events are triggered on the document to call any handlers who may be listening. The ajaxSuccess event is only called if the request is successful. It is essentially a type function that's called when a request proceeds.
AJAX allows web pages to be updated asynchronously by exchanging data with a web server behind the scenes. This means that it is possible to update parts of a web page, without reloading the whole page.
Answer!
If you have developed a custom Web page that launches a ClickOnce application using Active Scripting, you may find that the application will not launch on some machines. Internet Explorer contains a setting called Automatic prompting for file downloads, which affects this behavior. This setting is available on the Security Tab in its Options menu that affects this behavior. It is called Automatic prompting for file downloads, and it is listed underneath the Downloads category. The property is set to Enable by default for intranet Web pages, and to Disable by default for Internet Web pages. When this setting is set to Disable, any attempt to activate a ClickOnce application programmatically (for example, by assigning its URL to the document.location property) will be blocked. Under this circumstance, users can launch applications only through a user-initiated download, for example, by clicking a hyperlink set to the application's URL.
So change the IE security settings to turn automatic prompting for file downloads on.
I have the same problem. One possible solution is changing ajax request from asynchronous to synchronous. If you do that then 'Automatic prompting isn't needed at all.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With