C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




Getting other than AppSetting values from Web.Config


Posted Date: 29 Aug 2007    Resource Type: Code Snippets    Category: ASP.NET WebForms

Posted By: Satish Kumar J       Member Level: Diamond
Rating:     Points: 7



We can get AppSetting values from Web.Config file but other than AppSettings if we want to access then following code will help you, following code reads the SessionState tag and prints the timeout value similarly you can used for other details also.





System.Configuration.ConfigXmlDocument xml1 = new System.Configuration.ConfigXmlDocument();
xml1.Load(Server.MapPath("web.config"));
XmlNodeList xmlele = xml1.GetElementsByTagName("sessionState");
foreach(XmlAttribute xmlattr in xmlele.Item(0).Attributes)
{
if(xmlattr.Name == "timeout")
{
Response.Write(xmlattr.Value);
}
}






Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Track the visitors in the site
Previous Resource: Sending E-mails with ASP.NET 2.0 using C#
Return to Discussion Resource Index
Post New Resource
Category: ASP.NET WebForms


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

conference call definitions

Contact Us    Privacy Policy    Terms Of Use