Using an explicit localization expression for a page title?

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-16 08:05:19

问题


I am trying to get an explicit localization expression for a page title, but can't seem to figure out how, and a google search comes up with nothing.

With a control, it's nice and easy:

<asp:literal runat="server" text="<%$ Resources:MyResource, StringId %>" />

But how does one do this for the page title? I've tried specifying it in the page directive, but that of course doesn't work:

<%@ Page Title="<%$ Resources:MyResource, StringId %>" ...

Is there a way to do this? Or is it simply not possible?


回答1:


You can also use either

Page.Title = Resources.MyResource.StringId;

or

<title><%= Resources.MyResource.StringId %></title>



回答2:


simply in the page load event write

Page.Title="any String u want";


来源:https://stackoverflow.com/questions/5644809/using-an-explicit-localization-expression-for-a-page-title

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!