我从CodeBehind动态生成ListItems,并希望Text为资源属性。我使用以下代码:
ddl_pdfalignment.Items.Add(new ListItem("<%$Resources:space.language, cb_portrait_addtable %>", "portrait"));
但我的输出是:&lt;%$ Resources:space.language,cb_portrait_addtable%&gt; 而不是:
PDF Orientationmode:portrait
保存在资源文件中。
我该如何解决这个问题?
答案 0 :(得分:2)
YourItem.Text = GetGlobalResourceObject("your_resource_file_name", "key_in_resource").ToString();
尝试使用它