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

Forums / Bugs & Issues / NewsList, SingleNews & newsRotator Problem

NewsList, SingleNews & newsRotator Problem

5 posts, 0 answered
  1. obirah
    obirah avatar
    7 posts
    Registered:
    30 Jan 2007
    12 Oct 2007
    Link to this post
    Hello,

    I am trying to connect newsRotator, 4 news items and the SingleNews control to work properly but I have the following problems:

    1. I can't make my news preview (I display thumbnail & summary only) to become a link (to go to a SingleNews page)

    2. When I create a SingleNews control and want to add an ArticleID from a local PC I am told that I can do it only from the PC where the project is running. When I try that I get the following error: (ContentSelector.ascx does not exist)

    Server Error in '/GolchevKomm' Application. 
    -------------------------------------------------------------------------------- 
     
    The file '/GolchevKomm/Sitefinity/Admin/ControlTemplates/News/ContentSelector.ascx' does not exist.  
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.  
     
    Exception Details: System.Web.HttpException: The file '/GolchevKomm/Sitefinity/Admin/ControlTemplates/News/ContentSelector.ascx' does not exist. 
     
    Source Error:  
     
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.   
     
    Stack Trace:  
     
     
    [HttpException (0x80004005): The file '/GolchevKomm/Sitefinity/Admin/ControlTemplates/News/ContentSelector.ascx' does not exist.] 
       System.Web.UI.Util.CheckVirtualFileExists(VirtualPath virtualPath) +3480779 
       System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +109 
       System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +93 
       System.Web.UI.TemplateControl.LoadTemplate(VirtualPath virtualPath) +75 
       System.Web.UI.TemplateControl.LoadTemplate(String virtualPath) +23 
       Telerik.Cms.Engine.WebControls.ContentSelector.CreateChildControls() +420 
       System.Web.UI.Control.EnsureChildControls() +87 
       System.Web.UI.Control.PreRenderRecursiveInternal() +41 
       System.Web.UI.Control.PreRenderRecursiveInternal() +161 
       System.Web.UI.Control.PreRenderRecursiveInternal() +161 
       System.Web.UI.Control.PreRenderRecursiveInternal() +161 
       System.Web.UI.Control.PreRenderRecursiveInternal() +161 
       System.Web.UI.Control.PreRenderRecursiveInternal() +161 
       System.Web.UI.Control.PreRenderRecursiveInternal() +161 
       System.Web.UI.Control.PreRenderRecursiveInternal() +161 
       System.Web.UI.Control.PreRenderRecursiveInternal() +161 
       System.Web.UI.Control.PreRenderRecursiveInternal() +161 
       System.Web.UI.Control.PreRenderRecursiveInternal() +161 
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360 
     
      
     
     
    -------------------------------------------------------------------------------- 
    Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832  
     
     

    I will be really happy to know why this is happening 

    (Note: As a designer, I am not familiar with the ASP.NET syntax) 

    Best Regards,

    Milen

    Golchev & Komm
  2. obirah
    obirah avatar
    7 posts
    Registered:
    30 Jan 2007
    12 Oct 2007
    Link to this post
    I forgot to say: I am using Sitefinity 3.1 beta


    Regards,

    Milen
  3. Pepi
    Pepi avatar
    981 posts
    Registered:
    28 Oct 2016
    12 Oct 2007
    Link to this post
    Hello Milen,

    1. Could you please send us a mock-up demonstrating what you want to achieve? Also it will be very helpful if you could provide us with the code that you are working on.
    2. Copy the .ascx file from the attachment in the following folders:
    • ~/Sitefinity/Admin/ControlTemplates/Blogs
    • ~/Sitefinity/Admin/ControlTemplates/News
          And after that copy the .res file in the corresponding  App_LocalResources folder:
    • ~/Sitefinity/Admin/ControlTemplates/Blogs/App_LocalResources
    • ~/Sitefinity/Admin/ControlTemplates/News/App_LocalResources
    Thanks for your cooperation in advance.

    Kind regards,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  4. obirah
    obirah avatar
    7 posts
    Registered:
    30 Jan 2007
    12 Oct 2007
    Link to this post
    Hello Pepi,

    thank you for the fast reply!

    Problem 1 - see http://www.golchev.com/controls.jpg

    The issue is that I can't include the link in the newsRotator.ascx and when I put it (see code below) it gets underlined and works as a link but there is no field in newsRotator where I can define the singleNews page.

    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="NewsRotator.ascx.cs" Inherits="UserControls_NewsRotator" %> 
    <%@ Register Assembly="RadRotator.Net2" Namespace="Telerik.WebControls" TagPrefix="radR" %> 
     
    <radR:RadRotator ID="newsRotator" runat="server"
        <FrameTemplate> 
             
            <div id="test"
            <asp:HyperLink ID="newsLink" runat="server" CssClass="astrong"
            <asp:Image ID="Thumbnail" ImageUrl='<%#DataBinder.Eval(Container.DataItem, "Thumbnail")%>' runat="server"/> 
            </div> 
            <div id="test2"
            <asp:Label ID="newsTitle" runat="server"></asp:Label> 
             
            </asp:HyperLink> 
            </div> 
             
        </FrameTemplate> 
    </radR:RadRotator> 

    The big issue is that NewsList defines one SingleNews page for all items. As you already saw in the screenshot I need the news items redirected to their individual pages so they can be accessed as "products".

    How can this be done and where is my mistake!

    Problem 2 is solved with the files you provided.Thanks!


    Best regards,

    Milen

    Golchev & Komm 
  5. Pepi
    Pepi avatar
    981 posts
    Registered:
    28 Oct 2016
    15 Oct 2007
    Link to this post
    Hello Milen,

    In the attachment you could find an improved version of NewsRotator user control. It contains SingleNewsPage property that gets or sets the page containing SingleNews control.

    If I understand correctly from the image (http://www.golchev.com/controls.jpg), you need a SingleNews page for each item because there is an individual picture for the different news. If I am right, there is an easy way to achieve this than generating a page for every news item (I am not sure if it's a possible scenario for now). For example, you can create a User Control that contains an Image control and set its ImageUrl property according to the specific news. You could get the ID of the news item from the current HttpContext object. For example:

    protected void Page_Load(object sender, EventArgs e) 
        { 
            object obj = this.Context.Items["ArticleID"]; 
            if (obj != null
                this.articleId = (Guid)obj; 
     
            if (articleId == new Guid("585a7842-f41b-4578-849b-c710d42a4d86")) 
                Image1.ImageUrl = "~/Images/Blue hills.jpg"
        } 
     
        private Guid articleId; 

    Hope this helps.

    Kind regards,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Register for webinar
5 posts, 0 answered