Get value from web config <appSettings>.
<add key="adminuser" value="Administrator" />
<add key="adminpassword" value="GC@gcomm123456" />
In Controller write:
string adminuser = WebConfigurationManager.AppSettings["adminuser"];
string adminpassword = WebConfigurationManager.AppSettings["adminpassword"];
Use this reference: using System.Web.Configuration;
No comments:
Post a Comment