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

Forums / Developing with Sitefinity / Problem with urlRewriteFormat when using Custom Provider and Control For Generic Content

Problem with urlRewriteFormat when using Custom Provider and Control For Generic Content

3 posts, 0 answered
  1. William Chang
    William Chang avatar
    12 posts
    Registered:
    05 Apr 2010
    23 Apr 2010
    Link to this post
    I added my own provider in "web.config" named "SpecialContent1" for Generic Content module. I created a custom user control (ascx) that present a list of content items to the end user. Everything is working so far, I can create and edit in the admin and I can view all the content items "like a list" on the page where I drag-and-drop my control in. But, when I made the header a link following the "urlRewriteFormat" from the "web.config" and accessing through code "itemContent.UrlWithExtension" to create the link. The problem is when I click on the link I generated, it doesn't work.

    For your information, the list page of content items is park/attractions/rides.aspx

    Server Error in '/' Application.
    The resource cannot be found.
    Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.
     
    Requested URL: /park/attractions/rides/SpecialContent1/Ride-2.aspx

    Please help. Thank you.
    William Chang
  2. William Chang
    William Chang avatar
    12 posts
    Registered:
    05 Apr 2010
    23 Apr 2010
    Link to this post
    Okay, I think my UserControl needs to implement UrlRewriterContainer. But, I don't know how to get the UrlRewriterContainer to work?

    For your information, I don't want to extend (or inherit) from ContentView webcontrol. I just want the content item pulled by the URL in my user control code-behind.
  3. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    26 Apr 2010
    Link to this post
    Hello William Chang,

    Could you please try adding this at the top of your class declaration:
    [Telerik.Web.UrlRewriterService("Telerik.Cms.Engine.ContentUrlRewriterService, Telerik.Cms.Engine")]
    public partial class UserControl: System.Web.UI.UserControl



    Best wishes,
    Radoslav Georgiev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Register for webinar
3 posts, 0 answered