More in this section

Forums / Developing with Sitefinity / Page Reference

Page Reference

4 posts, 0 answered
  1. Allen
    Allen avatar
    71 posts
    Registered:
    04 Aug 2007
    21 Mar 2008
    Link to this post
    First, I apologize for so many posts today, but I'm in the thick of it and a deadline is approaching.  Unfortunately, I find the help CHM just a little to sketchy on "real world" samples.  I wish there were better documentation with regard to the API.

    Anyway, is there a way from a custom user control to get a reference to the parent "cmsPage"?  I ask this because my client has asked that for several pages, she would like a "last modified" date to appear on the page - automatically.  So, I see that in the PageInfo object there is indeed a date modified (whether it's the published date or not - well, that's a different story).  Additionally, with other objects or interfaces (like IPage), I see some interesting info, but I do not know how to set that reference from the user control's perspective.

    Thanks in advance for you help.
  2. Nikifor
    Nikifor avatar
    232 posts
    Registered:
    18 May 2013
    26 Mar 2008
    Link to this post
    Hello Allen,

    Please find the attached a custom user control which contains the Method for getting content from CmsPage.
    All you have to do is:
    •  create a new directory in YourProject/ Sitefinity/User Control and name it CustomControl.
    • paste the attached files, WebUserControl.ascx and WebUserControl.ascx.cs, in it.
    • define the User control in the web.config file of the project. To add this user control to the Control Toolbox section of your project administration, paste the following line in the <toolboxControls> tag:
    <add name="Web User Control" section="CustomControl" url="~/Sitefinity/UserControls/CustomControl/WebUserControl.ascx" /> 


    Hope this is helpful.

    Greetings,
    Nikifor
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Allen
    Allen avatar
    71 posts
    Registered:
    04 Aug 2007
    27 Mar 2008
    Link to this post

    Thanks for the information.  It looks like exactly what I need, but just to clarify ...

    I am using v3.0 and I cannot find the ICmsUrlContext in the Telerik.CMS namespace.  Am I missing something?

    Thanks

     

  4. Nikifor
    Nikifor avatar
    232 posts
    Registered:
    18 May 2013
    27 Mar 2008
    Link to this post
    Hi Allen,

    We tested the control on a 3.0 SP2 version in our test environment and it is working as expected. We also verified your downloading history and this is just the version you run. Please check if you have followed the described steps in the previous post once again, and if the problem still persists, give us more details about it.

    Looking forward to hearing from you.

    Greetings,
    Nikifor
    the Telerik team

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