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

3 posts, 0 answers
  1. Scott MacFarlane
    Scott MacFarlane avatar
    5 posts
    Member since:
    Aug 2008

    Posted 01 Aug 2011 Link to this post


    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?

  2. Kevin
    Kevin avatar
    360 posts
    Member since:
    Jul 2012

    Posted 04 Aug 2011 Link to this post

    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.
  3. Slav
    Slav avatar
    1359 posts

    Posted 04 Aug 2011 Link to this post

    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;

    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,
    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.

Back to Top