I am trying to set the row limit for my gridview webpart on sharepoint site in the appsettings of the web.config file.
<appSettings>
<add key ="RowLimit" value="6"/>
<add key="FeedCacheTime" value="300" />
<add key="FeedPageUrl" value="/_layouts/feed.aspx?" />
<add key="FeedXsl1" value="/Style Library/Xsl Style Sheets/Rss.xsl" />
<add key="ReportViewerMessages" value="Microsoft.SharePoint.Portal.Analytics.UI.ReportViewerMessages, Microsoft.SharePoint.Portal, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
and then in my code file i am using the below statement
string x = ConfigurationSettings.AppSettings["RowLimit"];
this line is giving an error stating ConfigurationSettings.AppSettings “This method is obsolete”,
What is that i am doing wrong? Please let me know.
You should be using the ConfigurationManager class instead.
ConfigurationSettingswas deprecated in .NET 2.0. Use it the same way as you would useConfigurationSettings, but be aware that you will have to add a reference to System.Configuration, if you don’t have it already.