Tuesday, October 18, 2022

Access web config.

 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

Screen Record

 Windows Screen Record WindowsKey+ Alt + R Recording Starts.