Nancy
Nancy

Reputation: 147

Global Resource Issue in MonoDevelop Xamarin Studio

The following code:

<asp:Button runat="server" Text="<%$Resources:Main, Save %>" />

is producing the following error:

Error: Unexpected '<' in tag 'asp:Button'.

Details:

ASP.net 4.0 Web Application (C#)
Xamarin Studio Version 4.0.12 (build 3

Is there a workaround for this issue?

Edit:

Will mono framework parse the resource if the solution was compiled by Visual Studio targeting "Mono 2.8 Profile"?

Upvotes: 1

Views: 401

Answers (1)

TombMedia
TombMedia

Reputation: 1972

Nope, you can't even use single quotes like you can in Visual Studio to get away with code like that. You're going to have to use code-behind to accomplish what you are trying. Sorry

To answer your edit, your syntax is valid. The problem is with Monodevelop not Mono. Nothing in the C# spec states that what you are doing is wrong, this is a parser issue with quotes and brackets in a specific tool.

The implicit syntax should work in its stead:

<asp:Button runat="server" Text="DefaultText" meta:resourcekey="Save" />

More reading: ASP.NET Web Page Resources Overview

Upvotes: 2

Related Questions