<div>Hi,</div> <div></div> <div>I have links in view page. when i am running application in chrome browser,then When i click on link, it should always open in Inter Explorer browser instead of chrome browser.</div> <div>Please
find my code in below. Report URL is the column contains links. When i click on link , it should always open in Internet Explorer.</div> <div></div> <div> <div><table class="table table-hover"></div> <div> <thead></div>
<div> <tr></div> <div></div> <div> <th scope="col">Report Name</th></div> <div> <th scope="col">Report URL</th></div> <div> </tr></div> <div>
</thead></div> <div> <tbody></div> <div>@foreach (var row in Model)</div> <div>{</div> <div> <tr></div> <div></div> <div> <td></div> <div>
@row.reportName</div> <div></div> <div> </td> </div> <div></div> <div></div> <div> <td><a href="@row.reportURL" target="_blank" >@row.reportURL</a></td></div>
<div></div> <div></div> <div> </tr></div> <div></div> <div></div> <div>}</div> <div> </tbody></div> <div></div> <div></table></div>
</div>
What you want to achieve is not possible. You cannot use MVC or Javascript to control which browser should be used when a link is clicked in a web page.
Thank you for quick reply. While i was doing R&D , i found some code. But i am not sure will it work or not.
Can we use this way.
function openURL() {
var shell = new ActiveXObject("WScript.Shell");
shell.run("IE http://www.google.com");
}
No. ActiveX is not supported in Chrome. As I said, what you want to achieve is not possible.
Of more interest is the reason why you want to force the user to use IE. Does your web page rely on other technology that's only supported in IE? Perhaps if you explained the reason behind your question, someone might be able to suggest an alternative
approach.
I have SSRS reports link which i have shown in my UI. In some SSRS reports, i have Date field. if you run the report on chrome , the Date icon is not showing. Hence user facing issue to use chrome. When they run same SSSRS report on IE, Date icon is visible
. User is able to click icon to select date field. This is the challenge am facing. If any one have answer for this, please reply. It will be great help for me. So i want when user run the application via chrome, and they click on SSRS report link, it should
automatically redirect IE browser and open the link.
Stricly speaking it could be done on fully controlled machines or maybe under Windows 10 (if I remember, there is a custom protocol handler that allows to switch to IE).
I would rather spend my R&D on looking if the site couldn't be upated to not require a particular browser.
It will be great help for me. So i want when user run the application via chrome, and they click on SSRS report link, it should automatically redirect IE browser and open the link.
kamalsekhar, your approach will NOT work. Drop the current approach and move forward with a new approach.
I recommend troubleshooting the Data Icon to figure out why it does not show in chrome. Have you tried dev tools?
Perhaps you need to upgrade your version of SSRS to work with Chrome?
As already mentioned, this is not possible. If one particular feature is not compatible with a browser, what we usually do is display a message on the top saying some of the features would not work in this browser. You can use some JS code like below to
target that out and just alert the user saying please use IE.
This is what SharePoint is doing anyway. Some features only works in IE so they basically display a message to the user saying open this web page in IE. It's up to the user to open it in IE or not. Your web application can't and shouldn't open up applications
in client PC.
I wonder also if you couldn't make this work by updating browser config files used by ASP.NET. Which version of SSRS are you using ? My first move would be still to make 100% sure about the problem and maybe try to fix this.
Member
6 Points
76 Posts
How to open link from chrome browser to Internet Explorer in MVC
Jun 26, 2019 06:50 AM|kamalsekhar|LINK
All-Star
194886 Points
28105 Posts
Moderator
Re: How to open link from chrome browser to Internet Explorer in MVC
Jun 26, 2019 07:04 AM|Mikesdotnetting|LINK
What you want to achieve is not possible. You cannot use MVC or Javascript to control which browser should be used when a link is clicked in a web page.
Member
6 Points
76 Posts
Re: How to open link from chrome browser to Internet Explorer in MVC
Jun 26, 2019 10:21 AM|kamalsekhar|LINK
Hi,
Thank you for quick reply. While i was doing R&D , i found some code. But i am not sure will it work or not.
Can we use this way.
function openURL() {
var shell = new ActiveXObject("WScript.Shell");
shell.run("IE http://www.google.com");
}
All-Star
53751 Points
24070 Posts
Re: How to open link from chrome browser to Internet Explorer in MVC
Jun 26, 2019 11:33 AM|mgebhard|LINK
ActiveX is long gone in modern browsers and only support by IE ending with IE 11.
All-Star
194886 Points
28105 Posts
Moderator
Re: How to open link from chrome browser to Internet Explorer in MVC
Jun 26, 2019 11:49 AM|Mikesdotnetting|LINK
Of more interest is the reason why you want to force the user to use IE. Does your web page rely on other technology that's only supported in IE? Perhaps if you explained the reason behind your question, someone might be able to suggest an alternative approach.
Member
6 Points
76 Posts
Re: How to open link from chrome browser to Internet Explorer in MVC
Jun 26, 2019 02:07 PM|kamalsekhar|LINK
Hi,
Thank you for your information.
I have SSRS reports link which i have shown in my UI. In some SSRS reports, i have Date field. if you run the report on chrome , the Date icon is not showing. Hence user facing issue to use chrome. When they run same SSSRS report on IE, Date icon is visible . User is able to click icon to select date field. This is the challenge am facing. If any one have answer for this, please reply. It will be great help for me. So i want when user run the application via chrome, and they click on SSRS report link, it should automatically redirect IE browser and open the link.
All-Star
48740 Points
18196 Posts
Re: How to open link from chrome browser to Internet Explorer in MVC
Jun 26, 2019 02:08 PM|PatriceSc|LINK
Hi,
Stricly speaking it could be done on fully controlled machines or maybe under Windows 10 (if I remember, there is a custom protocol handler that allows to switch to IE).
I would rather spend my R&D on looking if the site couldn't be upated to not require a particular browser.
Member
6 Points
76 Posts
Re: How to open link from chrome browser to Internet Explorer in MVC
Jun 26, 2019 02:14 PM|kamalsekhar|LINK
Hi,
Could you please clarify more on this. I am not getting what you are trying say on this.
All-Star
53751 Points
24070 Posts
Re: How to open link from chrome browser to Internet Explorer in MVC
Jun 26, 2019 02:17 PM|mgebhard|LINK
kamalsekhar, your approach will NOT work. Drop the current approach and move forward with a new approach.
I recommend troubleshooting the Data Icon to figure out why it does not show in chrome. Have you tried dev tools?
Perhaps you need to upgrade your version of SSRS to work with Chrome?
https://docs.microsoft.com/en-us/sql/reporting-services/browser-support-for-reporting-services-and-power-view?view=sql-server-2017
If you are unable to upgrade SSRS or fix the Data icon, then alert your users to use IE.
All-Star
52793 Points
9695 Posts
MVP
Re: How to open link from chrome browser to Internet Explorer in MVC
Jun 26, 2019 09:59 PM|Ruchira|LINK
Hi,
As already mentioned, this is not possible. If one particular feature is not compatible with a browser, what we usually do is display a message on the top saying some of the features would not work in this browser. You can use some JS code like below to target that out and just alert the user saying please use IE.
https://stackoverflow.com/questions/4565112/javascript-how-to-find-out-if-the-user-browser-is-chrome/13348618#13348618
This is what SharePoint is doing anyway. Some features only works in IE so they basically display a message to the user saying open this web page in IE. It's up to the user to open it in IE or not. Your web application can't and shouldn't open up applications in client PC.
Please 'Mark as Answer' if this post helps you
My Tech BlogAll-Star
48740 Points
18196 Posts
Re: How to open link from chrome browser to Internet Explorer in MVC
Jun 27, 2019 06:49 AM|PatriceSc|LINK
I checked and saw actually that for Edge only : <a href="microsoft-edge:https://www.google.com/">Edge</a> should ask for opening this link in Edge.
Which version of SSRS are you using ?I would really try to fix the actual problem.
Member
6 Points
76 Posts
Re: How to open link from chrome browser to Internet Explorer in MVC
Jun 27, 2019 02:48 PM|kamalsekhar|LINK
Hi PatriceSc,
Really, I would like to thank you so much for solution. Its working fine now.
How to open in Internet explorer browser instead of Microsoft Edge ?
Update: Users are using windows 7 OS. They want to open URL in internet explorer . In windows 7 , microsoft -edge is not there. Please help me .
All-Star
48740 Points
18196 Posts
Re: How to open link from chrome browser to Internet Explorer in MVC
Jun 28, 2019 07:35 AM|PatriceSc|LINK
You would need to deploy your own custom protocol handler. I see also https://stackoverflow.com/questions/34276929/how-can-i-get-ssrs-and-chrome-to-work-together which suggest to use extensions.
I wonder also if you couldn't make this work by updating browser config files used by ASP.NET. Which version of SSRS are you using ? My first move would be still to make 100% sure about the problem and maybe try to fix this.
Contributor
6061 Points
2516 Posts
Re: How to open link from chrome browser to Internet Explorer in MVC
Jul 06, 2019 11:43 AM|KathyW|LINK
I don't see a mention of what version you are using, but if you can use the latest version, it supports Chrome.
https://docs.microsoft.com/en-us/sql/reporting-services/browser-support-for-reporting-services-and-power-view?view=sql-server-2017
https://docs.microsoft.com/en-us/sql/reporting-services/create-deploy-and-manage-mobile-and-paginated-reports?view=sql-server-2017