2
我无法在全球化的母版页中使用以下代码&本地化。它给出了错误的代码部分评论说:“不包含认定中的InitializeCulture”ASP.NET网页全球化和主页中的本地化C#3.0
protected override void InitializeCulture()
{
if (Request["Language"] != null)
{
//String selectedLanguage = Request["Language"];
// code wil go here
}
base.InitializeCulture();
//base.InitializeCulture gives error as mentioned in the next line
//does not contain a defination for InitializeCulture
}
当我将此代码添加到比母版页等其他网页正常工作。在Master Page中使用此代码是否有任何限制。
如果我能够在母版页中定义此代码,那么我不需要在每个文件中编写此代码。
难道我做错了什么,我有包括线程和全球化文件,不过它并没有在母版页
我不知道我怎么做,我是新来的节目..我会尝试。谢谢 – Learning 2012-01-02 16:00:53
我添加了一些代码。希望这可以帮助。如果它是正确的,请将我的答案标记为已回答。 – slfan 2012-01-02 16:48:45
@slfan如果我想本地化一个位于'MasterPage'上的标签,所以你说不使用'MasterPage',而是让你拥有从'Page'继承的BaseMasterPage。 – PUG 2012-10-10 19:07:24