1

We have the 2sxc AppBlog module in place and it has been working for months. Suddenly, I get contacted from the client that it's not working. When the page loads, the error is 'Error rendering template.' In the logs, the full exception is:

Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: 'ASP._Page_Portals_0_2sxc_Blog_App__library_cshtml' does not contain a definition for 'LinkToPageNumber'
at CallSite.Target(Closure , CallSite , Object , Int32 )
at ASP._Page_Portals_0_2sxc_Blog_App__pager_cshtml.Execute() in c:\Webs\TAD\Portals\0\2sxc\Blog App\_pager.cshtml:line 18
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
at System.Web.WebPages.WebPageBase.<>c__DisplayClass7.<RenderPageCore>b__6(TextWriter writer)
at System.Web.WebPages.HelperResult.WriteTo(TextWriter writer)
at System.Web.WebPages.WebPageBase.Write(HelperResult result)
at ASP._Page_Portals_0_2sxc_Blog_App__1_Main_blog_view_cshtml.Execute() in c:\Webs\TAD\Portals\0\2sxc\Blog App\_1 Main blog view.cshtml:line 23
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
at ToSic.SexyContent.Engines.RazorEngine.Render(TextWriter writer) in C:\Projects\2SexyContent\Web\DesktopModules\ToSIC_SexyContent\2Sexy Content Razor\RazorEngine.cs:line 65
at ToSic.SexyContent.Engines.RazorEngine.RenderTemplate() in C:\Projects\2SexyContent\Web\DesktopModules\ToSIC_SexyContent\2Sexy Content Razor\RazorEngine.cs:line 75
at ToSic.SexyContent.Engines.EngineBase.Render() in C:\Projects\2SexyContent\Web\DesktopModules\ToSIC_SexyContent\SexyContent\Engines\EngineBase.cs:line 89
at ToSic.SexyContent.SxcInstance.Render() in C:\Projects\2SexyContent\Web\DesktopModules\ToSIC_SexyContent\SexyContent\SxcInstance.cs:line 200

Any ideas what's up?

NEER
  • 3,932
  • 5
  • 17
  • 34
fordmantpw
  • 21
  • 3

1 Answers1

1

Well, through more digging, I was able to fix the issue myself. The code in the _pager.cshtml file was calling lib.LinkToPageNumber. lib was referenced to another .cshtml file, but LinkToPageNumber was a method in the _pager.cshtml file itself. All I had to do was remove lib. in front of the several instances of LinkToPageNumber, and all was well.

This error only showed up when our blog went past 1 page, and that's why it was working fine up until that point.

fordmantpw
  • 21
  • 3