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

Forums / Developing with Sitefinity / Page cache during development problem

Page cache during development problem

4 posts, 0 answered
  1. Scott MacDonald
    Scott MacDonald avatar
    29 posts
    Registered:
    08 Mar 2006
    19 May 2013
    Link to this post
    Hello,

    I cannot seem to figure out why my masterpage templates are still caching my codebehind logic even after disabling caching in Sitefinity admin. Just as a test I can do the following in page_load:

    string pageTitle = SiteMapBase.GetActualCurrentNode().Title.ToString();
    Response.Write(pageUrl);

    And it writes out the current page title. I then comment it out or even remove it all together, rebuild and it will still display the page title on the page. I have tried everything. I have disabled output caching and client caching in the Sitefinity admin, disabled browser caching, cleared the cache, opened the site in VS as a website to see if the JIT would help, closed VS and re-opened, and even rebooted my PC and it will still be displaying the response.write value on the page.

    If I pull those two lines of code out and rebuild and go back to the Sitefinity page templates and try to view the masterpage, it errors on the the first line(line 20) of the code even though I've taken them out and rebuilt the project:

    Server Error in '/' Application.Object reference not set to an instance of an object.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.NullReferenceException: Object reference not set to an instance of an object.

    Source Error: 

    Line 18: {
    Line 19:
    Line 20: string pageTitle = SiteMapBase.GetActualCurrentNode().Title.ToString();
    Line 21: Response.Write(pageTitle); 

    Is there something I'm missing here? It shouldn't be this hard. How have you all gotten around this? I'm using VS2010 with the built-in webserver and SF6. 

    Thanks,

    Scott
  2. Scott MacDonald
    Scott MacDonald avatar
    29 posts
    Registered:
    08 Mar 2006
    19 May 2013 in reply to Scott MacDonald
    Link to this post
    OMG this is bananas...when I click on the page template above to view it and it errors with the "object reference not set to an instance of an object", the source of the error is "App_Master\Site1.Master.cs    Line: 20". That's not even the masterpage associated with this template! How is it possible that I click on a page template to view it and I get an error from a completely different template and it's masterpage?

    Scott
  3. Scott MacDonald
    Scott MacDonald avatar
    29 posts
    Registered:
    08 Mar 2006
    21 May 2013 in reply to Scott MacDonald
    Link to this post
    Well I found out that it was doing that because while troubleshooting I had rebuilt the page using the SiteMap1 page code because something wasn't working and I created the SiteMap1 page as a test. Well on the main front end Master page I forgot to change the reference to the code behind. It was still set to something like this:

    <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site1.Master.cs" Inherits="SitefinityWebApp.Site1" %>

    Stupid mistake. Also, on the page caching as soon as I made sure the Output Caching checkbox options were checked and the configuration set to "No Cache" everything started working as expected. I had unchecked those boxes thinking it would disable caching but I guess it doesn't. Or atleast it didn't for me.

    Scott
  4. Jen Peleva
    Jen Peleva avatar
    568 posts
    Registered:
    10 Nov 2016
    22 May 2013
    Link to this post
    Hi Scott,

     I'm glad that you were able to resolve the issue. Don't hesitate to contact us if you have any further problems!

    Regards,
    Jen Peleva
    Telerik
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
4 posts, 0 answered