简体   繁体   中英

Access Resource files inside server tag

Hi I am stuck when I am trying to access the resource file from a server tag.

<WebPartPages:WebPartZone runat="server" Title ="<%= SPUtility.GetLocalizedString("$Resources:WebPartZoneTitle_Header", "TestResource", SPContext.Current.Web != null ? SPContext.Current.Web.Language : 1033) %>" ID="FullPage" FrameType="TitleBarOnly">  

This throws a Exception telling Server tags cannot contain <% ... %> constructs

Isn't there anyways that I can access resource file inside a server tag. I have tried <%$ Resources:WebResources, ReqLodgeName %> this format as well.

You can set the Title property of your control in the code-behind of your page. That not only works, it is much cleaner as well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM