Page cache during development problem

Posted by Community Admin on 04-Aug-2018 15:45

Page cache during development problem

All Replies

Posted by Community Admin on 19-May-2013 00:00

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

Posted by Community Admin on 19-May-2013 00:00

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

Posted by Community Admin on 21-May-2013 00:00

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

Posted by Community Admin on 22-May-2013 00:00

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

This thread is closed