Try Now
More in this section

Forums / Bugs & Issues / Error Rendering Control

Error Rendering Control

2 posts, 1 answered
  1. Gold Coaster
    Gold Coaster avatar
    1 posts
    19 Oct 2009
    19 Oct 2009
    Link to this post

    I am experiencing this error with a custom module on the public view while in design mode. I have simply clicked on 'Edit this page' within the cms

    Error Rendering control
    An unhandled exception has occured
    Page cannot be null. Please ensure that this operation is being performed in the context of an ASP.net request.

    The odd thing is that if I cancel the changes or save the changes when I arrive back in the admin pages section the module renders fine.

    The page is functional and works great in the web browser but the module does not render in design mode. I have a rad upload control on the public view...what seems to be the problem with this? If I remove it all is good. And what are my options to fix the error.

    The following is an example of my markup....


    <telerik:RadUpload ID="filCoverLetter" CssClass="file" runat="server" AllowedFileExtensions=".doc,.docx,.pdf" ControlObjectsVisibility="None"



    Skin="Sitefinity" EnableEmbeddedSkins="false" InitialFileInputsCount="1" width="300">






    <asp:CustomValidator runat="server" id="valCoverLetter" clientvalidationfunction="ValidateCoverLetterType"



    ErrorMessage="* required field" Display="Dynamic" CssClass="validMessage" ValidationGroup="career">



    <strong>Please select a valid file type (.doc, .docx or pdf)</strong>



    </asp:CustomValidator >



    <asp:CustomValidator runat="server" id="valCoverLetterUpload" clientvalidationfunction="ValidateCoverLetterUpload"



    ErrorMessage="* required field" Display="Dynamic" CssClass="validMessage" ValidationGroup="career">



    <strong>Please select a cover letter</strong>



    </asp:CustomValidator >


  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    19 Oct 2016
    19 Oct 2009
    Link to this post
    Hi Gold Coaster,

    On the public side you have controls( user or custom). You cannot have modules. The modules are used at the backend. However the problem you have is that the controls in your template expects a page. Since we use not physical pages in Page Edit mode the page is null and your controls cannot be rendered. You can override Render or InitializeControls method and check whether you are in Design mode and the page is null and show user friendly message.

    if (Page == null || DesignMode)
                    Label lbl = new Label();
                    lbl.Text = "The control cannot be previewed in edit mode";
                    this.MyControl.Visible = false;

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
2 posts, 1 answered