Solution to Windows. Open in IE8

Source: Internet
Author: User
To download files in a project, use Windows. Open to access the download page. However, in IE, you need to set IE8.
Setting method:
If your IE8 icon is on the desktop, right-click the icon and select "properties" to go to IE8 settings. Alternatively, open IE8, select "Tools"-"Internet Options" in the upper-right corner of the toolbar, enter the settings, and click "Settings" in the pop-up property settings window ", then, in the section "when a new window is encountered", select "always open a pop-up window in the new tab ",
In the section "open links from other programs located below", select "New tabs in the current window", and click "OK ".
However, this is not an effective method. As a web project, you cannot tell the user to make complicated settings when the user needs to access it.
How can this problem be achieved?
The page cannot be redirected. The download function is available on this page.
Use the acetionresult returned by mvc3 to download the file. On the page, use window. Location. href = "action" to access this action.
C # code:
Public actionresult about () {return file ("/content/site.css" // file path, "*/Excel" // file type, "dowloa.xls" // download file name );;}
HTML and JS Code
<MCE: Script Type = "text/JavaScript" src = ".. /.. /scripts/jquery-1.4.4.js "mce_src =" scripts/jquery-1.4.4.js "> </MCE: SCRIPT> <MCE: Script Type =" text/JavaScript "> <! -- $ (Document ). ready (function () {$ ('A '). click (function () {window. location. href = "home/about"}); // --> </MCE: SCRIPT> <H2> @ viewbag. message </H2> <p> <A> test </a> </P>
Effect


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.