locked
web.config in sharepoint RRS feed

  • Question

  • hi

    i need to add my custom list name("mynews") in web.config and retrive it's value by object model

    i apperiate  ur help
    • Changed type Mike Walsh FIN Sunday, October 25, 2009 1:04 PM question
    Sunday, October 25, 2009 8:17 AM

Answers

  • dears

    i got the answer


    at appsetting

    you can add key with name and value

    at object model

    retriver by this

     

     

     

    <appSettings>

     

     

    <add key="listname" value="mynews" />


    </appSettings>



    at object model


    string listname= ConfigurationManager.AppSettings["mynews"].ToString();


    • Proposed as answer by eblanco Sunday, October 25, 2009 8:30 PM
    • Marked as answer by Eng.salim Monday, October 26, 2009 5:25 AM
    Sunday, October 25, 2009 9:47 AM

All replies

  • dears

    i got the answer


    at appsetting

    you can add key with name and value

    at object model

    retriver by this

     

     

     

    <appSettings>

     

     

    <add key="listname" value="mynews" />


    </appSettings>



    at object model


    string listname= ConfigurationManager.AppSettings["mynews"].ToString();


    • Proposed as answer by eblanco Sunday, October 25, 2009 8:30 PM
    • Marked as answer by Eng.salim Monday, October 26, 2009 5:25 AM
    Sunday, October 25, 2009 9:47 AM
  • You can read the settings just like in any other webapp.
    Also you can modify the web.config in all the servers in the farm by using the SPWebconfigModifications class: http://www.crsw.com/mark/Lists/Posts/Post.aspx?ID=32 it is very useful when you have to apply or add new settings to a multiple server farm.
    Sunday, October 25, 2009 8:30 PM