Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 25064

SharePoint 2013 - Using resource file in webpart, getting blank .ascx.g.cs file: "The name 'InitializeControl' does not exist in the current context."

$
0
0

Hey,


I am developing a webpart in a new SharePoint 2013 solution. I want to use resource files from a global resource file to fill out controls, like this:

<asp:Literal ID="Literal1" runat="server" Text="<%$Resources:MyResource,LiteralText%>" />

The problem arises when i try to build the solution; the corresponding .ascx.g.cs file is not generated, which results in getting the error message: "The name 'InitializeControl' does not exist in the current context." (This method is normally in the .ascx.g.cs file, though in this case, it is blank)

However if i replace the reference to the resource file with plain text, it builds perfectly without errors, and the .ascx.g.cs file is populated just fine:

<asp:Literal ID="Literal1" runat="server" Text="someText" />

What is causing this? And is there a solution/workaround? I have spent a wast amount of time on this without any luck..


Best regards
Esben Wiberg




Viewing all articles
Browse latest Browse all 25064

Trending Articles