Click here to Skip to main content
15,884,472 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi there,

what i want is a application can have multiple web.config.

suppose a config file for INDIA
a config file for Germany.

like that.
suppose india person logs in India config file should load
and if german person logs in Germany config file should load

is this possible

please help
Posted
Updated 5-Sep-12 1:19am
v3
Comments
manognya kota 5-Sep-12 6:21am    
Hi,

I guess the similar is posted here. http://www.codeproject.com/Questions/453447/Differentiating-between-two-connection-string? Please do not post the question twice.Instead use improve question.
suhailnoorpawane 5-Sep-12 6:28am    
My friend if you have understood the question.
This is about different config file and the one you posted is about different connection.
Have a look.
Thanks
Sandeep Mewara 5-Sep-12 6:43am    
And what difference will be there in each config file? Just few config settings, right? Rest everything same? Why you need such implementation?
sahabiswarup 5-Sep-12 6:53am    
Why do you want to load different config? is that because calculating that particular country's date time?
suhailnoorpawane 5-Sep-12 7:12am    
THEY WILL HAVE DIFFERENT DATABASE CONNECTION IN CONNECTIONSTRING WITH SIMILAR NAME

Keep contry wise folders and put your config files in that and call upon so..
 
Share this answer
 
As you have mentioned
THEY WILL HAVE DIFFERENT DATABASE CONNECTION IN CONNECTIONSTRING WITH SIMILAR NAME

You can achieve that by putting the connectionstring in the resource file rather than web.config. the resource file will be loaded based on the culture and you can read the respective connectionstring from the resource file.

[edit]

You will have to create a global resource file. refer to following articles for the usage part.
http://msdn.microsoft.com/en-us/library/ms227427.aspx[^]
Using Globalization and Localization in ASP.NET[^]
 
Share this answer
 
v2
Comments
suhailnoorpawane 5-Sep-12 8:25am    
so if once the resource file is loaded will it restart the application
suhailnoorpawane 5-Sep-12 8:25am    
can u show me how to do that if so please do the needfull
thanks
Rahul Rajat Singh 5-Sep-12 8:31am    
See some links in the answer(just updated)
yes it is possible,
That you can have multiple web.config file in your project.
But in root folder you must have it only one and then create directories as per country and add another web.config file in particular directory.

And for peoples who are used it to login based on Authentication rule.Please look into this example.
Working with more than one Web.config file[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900