Last post Apr 29, 2010 11:24 AM by RichardBladh
Nov 08, 2007 02:28 AM|Gustavo Villa|LINK
I have project to work with a web application to retrieve local and global resources from a DB. This project also replace the default tool of VS to create the local resources and when you use the Generate Local Resource tool adds all the resources of the
page to the DB.
You may know that this tool (Generate Local Resource) creates a group of resources for each control (for the label control, Text and Tooltip, for example) and I would like to add one property to be created in the DB when this tool is used. What I would like
to get is that this tool to generate the ImageUrl resource for Image controls.
Do you know How I can get this?
Culture Neutral vs. Culture Specific
UICulture Language Control Controls ASPNET
localization master subfolder
generate Local Resources
localization page layout
Nov 08, 2007 01:15 PM|jamlew|LINK
For runtime resource support, you need a class which descends from [url=http://msdn.microsoft.com/en-us/library/system.web.compilation.resourceproviderfactory.aspx]ResourceProviderFactory[/url] and appropriate [url=http://msdn.microsoft.com/en-us/library/system.web.compilation.iresourceprovider.aspx]IResourceProvider[/url]
implementations for the local and global resources. I recall finding some sample codes for using a database as a backend for your resources, but I didn't save the links. Just use search keywords like 'sql resource provider asp.net' or something similar and
it should be fairly easy to find.
For the design time support (i.e. Generate Local Resource), you need a class that descends from [url=http://msdn.microsoft.com/en-us/library/system.web.ui.design.designtimeresourceproviderfactory.aspx]DesignTimeResourceProviderFactory[/url] and implementations
for the corresponding IResourceProvider (for previewing I think) and [url=http://msdn.microsoft.com/en-us/library/system.web.ui.design.idesigntimeresourcewriter.aspx]IDesignTimeResourceWriter[/url]. I couldn't find any database samples for this when I was
trying to figure it out, but [url=http://www.leftslipper.com/ShowFaq.aspx?FaqId=9]here[/url] is a sample one using Access that you might be able to port. I didn't have enough time to try that msyelf.
Nov 09, 2007 05:57 AM|Gustavo Villa|LINK
The proyect we use has a class that implements
IDesignTimeResourceWriter that has the method AddResource(string name , object value) that implements System.Resources.IResourceWriter.AddResource, that save the data in a ListDictionary used, some steps later, to create the resources in the DB. This method
is called by VS, which send the resource name (e.g. Label1.Text) and the value, and I am again at the beginning.
There is another method System.Web.UI.Design.IDesignTimeResourceWriter.CreateResourceKey, as far I have tested, it is not called anytime.
Thank you, your indications has given me where to look for.
Apr 29, 2010 11:24 AM|RichardBladh|LINK
IDesignTimeResourceWriter.CreateResourceKey is called when a meta:resourcekey havn't been added on the control yet.