+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / DownloadList - open link in new browser

DownloadList - open link in new browser

3 posts, 0 answered
  1. Eric
    Eric avatar
    40 posts
    Registered:
    10 Apr 2009
    10 Aug 2009
    Link to this post
    Hello,

    Is there a setting that opens a DownLoadList item in a new browser window? 

    Eric
  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    12 Aug 2009
    Link to this post
    Hello Eric,

    You could create a custom control for that purpose. It should be located in the App_Code directory:

    CustomDownloadList.cs:
    using System; 
    using System.Collections.Generic; 
    using System.Linq; 
    using System.Web; 
    using Telerik.News.WebControls; 
    using Telerik.News; 
    using System.Collections; 
    using Telerik.Cms.Engine; 
    using Telerik.Libraries; 
    using System.Web.UI.WebControls; 
    using Telerik.Framework.Web.Design; 
    using System.Web.UI; 
    using System.ComponentModel; 
     
    /// <summary> 
    /// Summary description for CustomDownloadList 
    /// </summary> 
    namespace Telerik.Samples 
        [ToolboxItem(typeof(CustomDownloadList))] 
        public class CustomDownloadList : DownloadList 
        { 
     
            protected override void SetListMetadata(System.Web.UI.Control itemContainer, IContent contentItem) 
            { 
                base.SetListMetadata(itemContainer, contentItem); 
                HyperLink downloadLink = itemContainer.FindControl("DownloadLink"as HyperLink; 
                downloadLink.Attributes.Add("target","_blank"); 
            } 
            public override Type LocalizationAssemblyInfo 
            { 
                get 
                { 
                    return typeof(DownloadList); 
                } 
                set 
                { 
                    base.LocalizationAssemblyInfo = value; 
                } 
            } 
            public override System.Type AssemblyInfo 
            { 
                get 
                { 
                    return typeof(DownloadList); 
                } 
                set 
                { 
                    base.AssemblyInfo = value; 
                } 
            } 
     
        } 
     

    then register the control in the toolbox controls:

    web.config:

    <toolboxControls> 
    ... 
       <add name="CDownloadList" section="New" type ="Telerik.Samples.CustomDownloadList, App_Code "/> 

    Then, you could just use the custom control. 

    I hope this helps.

    Best wishes,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the newTelerik Support Portal.
    Check out the tipsfor optimizing your support resource searches.
  3. Eric
    Eric avatar
    40 posts
    Registered:
    10 Apr 2009
    24 Sep 2009
    Link to this post
    Thanks.  This worked perfectly.  I did have an issue because I have a precompiled site and I tried to put the App_Code directory on the server but once I got rid of the App_Code on the server then republished I was fine.

    Thanks again.
Register for webinar
3 posts, 0 answered