I could definitely accomplish what I want with a custom handler, but I was hoping it would be possible to adjust the web.config to define allowable cultures. Basically, I have a website that has resource files for a number of languages. I would like to deploy the same website to different domains with different configurations specifying the default cultures. I know I can set a specific culture to be used开发者_开发知识库 in the web.config, but can I also specify multiple cultures?
Even though I have English language resource files, I don't want a visitor from the US to certain domains to see the English version, but I can't fix the site for a single culture, either.
It sounds like you are asking three different questions:
Can you filter for the cultures used?
Yes. Create a base class for all your pages where you override the Page.InitializeCulture method and only allow certian cultures to be used.
Can you do it in web.config?
No. The best you can do in the web.config file is indicate a single culture.
Can you limit users from certain geographical places on the net?
This is a tougher question. First, you will never have perfect filtering as the Internet makes this pretty much impossible. However, you can get close by geo-locating based on IP. See Geolocation for more. There are a number of services on the net that will provide this functionality for you.
精彩评论