Working with resources
there! I'm working with asp.net 3.5 web-site. And I have such problem: I have 3 aspx pages, that contain asp:Label control with name "LabelContent" and foreach page I have two re开发者_如何学编程sx files, that contain LabelContentResource.Text and LabelContent binds LabelContentResource to , for 2 cultures. Also I have content editing page. On this page admin choses page for edit and in WYSIWG editor I need to load appropriate resorce. Like so:
string pageForLoadName = "links.aspx.de-AT.resx";
string key ="LabelContent.Text";
string resValue= LoadREsource(pageForLoadName ,key );
How can I write LoadREsource fnction? Thanks!
Something along the lines of
public string LoadResource(string pageForLoadName,string key)
{
return (String)HttpContext.GetGlobalResourceObject(pageForLoadName, key);
}
Also, don't think you need pageForLoadName = "links.aspx.de-AT.resx";
just pageForLoadName = "links.aspx.de-AT";
精彩评论