This is a migrated thread and some comments may be shown as answers.

Right-Clicking LinkButton Download to "Save Target As..."

2 Answers 112 Views
Button
This is a migrated thread and some comments may be shown as answers.
Scott MacFarlane
Top achievements
Rank 1
Scott MacFarlane asked on 01 Aug 2011, 06:52 PM
Hi,

I'm using the radbutton with the download icon to allow users to download files.

This works fine in most cases accept for mime types that the browser recognizes and opens directly
in the browser when the user would rather not open the file, but prefers to "Save As..." the file instead.

When I use a standard ASP.net hyperlink the user can either click to open or right click and select
"Save Target As..." and save it without opening it.

Is there any way to make the browsers work this way when using the radbutton as a download hyperlink?

Thank,
Scott

2 Answers, 1 is accepted

Sort by
0
Kevin
Top achievements
Rank 2
answered on 04 Aug 2011, 01:24 PM
Hello Scott,

How do you transmit the file to the page? In your Content-Disposition header, do you include "attachment;", as I believe that will force the Open/Save Dialog window for all file types.
0
Slav
Telerik team
answered on 04 Aug 2011, 02:47 PM
Hi Scott,

The missing "Save Target As..." option in the context menu of the RadButton, set as LinkButton, is encountered on IE and is caused by browser behavior. On the other major browsers this functionality works as expected.

A possible fix would be to override the styles and to set display: inline to the span by configuring its CSS class rbText:
<style type="text/css">
    .RadButton .rbText
    {
        display:inline !important;
    }
</style>

Please keep in mind that it's very likely to cause incorrectly displayed and aligned text in the button with this modification.

I hope the listed information helps.

Best wishes,
Slav
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Button
Asked by
Scott MacFarlane
Top achievements
Rank 1
Answers by
Kevin
Top achievements
Rank 2
Slav
Telerik team
Share this question
or