views:

15

answers:

1

Where is it best practice to set up the configuration such as connection strings or web service URL's in SharePoint 2010's Web Parts?

Web parts do not contain a web.config or an app.config and for good reason. So i wanted to know what everyone else does.

Would it be a good idea to create another assembly file along with your project?

Bill.

+1  A: 

WebPart refers the configuration file web.config of the Web Site where it is deployed to. So we all use web.config for storing all the configuration. Below Links will help you to get the value from the Web.Config

  1. To Read Connection String.
  2. To Read application Settings.
Kusek

related questions