let say you want to access app Settings value in your web.config file...first thing you need to include in your code behind : using System.Configuration
This code will enable you to access from your code behind value in web.config file at <appSettings></appSettings> element.
WebConfig file
<appSettings> <add key="key" value="2.0.0.0" /> </appSettings>
Code Behind .cs
using System.Configuration; : : string KeyVal = ConfigurationManager.AppSettings["Key"].ToString();
and variable KeyVal will have value 2.0.0.0 after executing this code.
By Mohd Zulkamal
NOTE : – If You have Found this post Helpful, I will appreciate if you can Share it on Facebook, Twitter and Other Social Media Sites. Thanks =)
0 comments:
Post a Comment