I would like to have this piece of code in my .aspx file:
<input class="ms-ButtonHeightWidth" type="button" name="BtnOK" id="Button2"
value="Close"
onclick="javascript:HandleOKButtonClick()"
accesskey="<%$Resources:wss,okbutton_accesskey%>" />
Unfortunately, ASP.net does not seem to like it:
An error occurred during the processing of /_layouts/MyPage/Info.aspx.
Literal expressions like '<%$Resources:wss,okbutton_accesskey%>' are not allowed.
Use <asp:Literal runat="server" Text="<%$Resources:wss,okbutton_accesskey%>" />
instead
This does not work in this situation, since it would mean embedding Literal between the quotes of the accesskey attribute, resulting in the error "The tag contains duplicate identifier attributes."
Is there a way to use a string from a resource without having to change the input in asp: Button? I suppose there should be a way using it <%=, but I don’t know how I could access the resource itself?
source
share