Reputation: 122
I was recently assigned a task of changing our asp.net web site localization to use custom resource provider (using sql database) instead of the default asrx resource files. Right now I'm chalenged with replacing hundreds of meta:resourcekey="resource-key"
with '<%$ Resources:[filename,]resource-key %>'
in our web site too many web pages. I want to do it programmatically.
first of all I'm not able to open .aspx files using XmlDocument, then I wonder how can I read meta:resource entries inside the aspx file as meta:resource is not any regular node attribute. any thoughts or example code how to solve this. Thx.
Note: in the inserted '<%$ Resources:[filename,]resource-key %>'
filename name sould be based on the aspx file name & resource-key on the control type and the resource value.
exemple: in UserPage.aspx page <asp:Label id="uid" meta:resource="userName">
should be replaced with <asp:Label id="uid" Text='<%$ Resources:UserPage,LBL_userName_text %>'
.
Upvotes: 0
Views: 756
Reputation: 24606
This isn't a programming answer, but a utility like PowerGREP may be a viable solution.
Upvotes: 2
Reputation: 39339
Html is not valid xml, so no wonder an XmlDocument didn't work. Especially with that <%$ .. %>
syntax.
Why not read it as plain text and search for the string "meta:resourcekey"?
Upvotes: 2