Pulling <identity> strings Anonymous User161023-Aug-2014In my Web.Config file, I have<identity userName="CTX_DOMAIN\ldapuser" password="ldapPW" />How can I pull these userName and password strings in my C# behind code?asp.netasp.net Updated on 23-Aug-2014
Sumit Kesarwani
23-Aug-2014This should work:
System.Web.Configuration.IdentitySection identityInfo = (System.Web.Configuration.IdentitySection)ConfigurationManager.GetSection("system.web/identity");
string userName = identityInfo.UserName;