Hi,
I have deployed my site on IIS 7 server. At certain conditions I want to disable one button. This is working at my local but after deploying it in IIS, it is not working. Here is my code.
protected void Page_Load(object sender, EventArgs e)
{
try
{
lFnEnabledisableServiceAuthentication();
}
catch (Exception)
{
}
}
void lFnEnabledisableServiceAuthentication()
{
try
{
string lStrUsers = "";
string lStrCurrentUser = "";
lStrUsers = ConfigurationManager.AppSettings["ServiceAuthUsers"].ToString();
lStrCurrentUser = clsGlobals.Prp_clsGlobals.mFnUpdateHostUser();
if (lStrUsers.Trim().ToLower() == lStrCurrentUser.Trim().ToLower())
{
btnInovisService.Enabled = true;
}
else
{
btnInovisService.Enabled = false;
}
}
catch (Exception)
{
throw;
}
}
<appSettings >
<add key="ServiceAuthUsers" value="MyaccountName"/>
appSettings>
Any suggestions like why this is happening..
Thanks
Sreenath

Posted May 23, 2011, 4:58 AM EDT
Try to hard-code value for the true part check it once...
Sreenath GRank #8,268 · 225 reputationPosted May 23, 2011, 5:02 AM EDT
Sreenath GRank #8,268 · 225 reputationPosted May 23, 2011, 5:03 AM EDT
Posted May 23, 2011, 5:42 AM EDT
System.Web.HttpContext.Current.User.Identity.Name.Split("\\".ToCharArray())[1].Trim();
Check the value of PhysicalPath settings in IIS 7.
Go to the Site in IIS 7-->Right Click -->manage web site-->Advanced Settings-->PhysicalPath Settings--?
Hope this helps you.
Suthish NairRank #92 · 22.8K reputationPosted May 23, 2011, 9:42 AM EDT
Sreenath GRank #8,268 · 225 reputationPosted May 23, 2011, 9:18 PM EDT
Posted May 23, 2011, 9:32 PM EDT
In the physical path settings( IIS 7-->Right Click -->manage web site-->Advanced Settings-->PhysicalPath Settings) have you configured Application user or Specific user ? Which option you have used ?
Sreenath GRank #8,268 · 225 reputationPosted May 24, 2011, 12:58 AM EDT
Suthish NairRank #92 · 22.8K reputationPosted May 24, 2011, 1:01 AM EDT
Sreenath GRank #8,268 · 225 reputationPosted May 24, 2011, 1:26 AM EDT
Suthish NairRank #92 · 22.8K reputationPosted May 24, 2011, 1:39 AM EDT
How To Deploy ASP.Net Web site Content on IIS 7.0
Deploying ASP.NET Websites on IIS 7.0
Sreenath GRank #8,268 · 225 reputationPosted May 24, 2011, 11:08 PM EDT
Posted May 24, 2011, 11:17 PM EDT
IIS-->Application Pools-->Right Click on your AppPool-->Advanced Settings--> Under Process Model check the Identity value.
Sreenath GRank #8,268 · 225 reputationPosted May 24, 2011, 11:23 PM EDT
Posted May 24, 2011, 11:44 PM EDT
Check the same AppPool identity value in IIS 6.0 and your location machine also.
If it is different, then you are reached the solution.
Sreenath GRank #8,268 · 225 reputationPosted May 25, 2011, 12:16 AM EDT
Sreenath GRank #8,268 · 225 reputationPosted May 25, 2011, 12:17 AM EDT
Sreenath GRank #8,268 · 225 reputationPosted May 25, 2011, 12:35 AM EDT
But how can I remove site from asking credenials..?
Posted May 25, 2011, 4:19 AM EDT
Sreenath GRank #8,268 · 225 reputationPosted May 25, 2011, 4:22 AM EDT
Posted May 25, 2011, 4:25 AM EDT
Sreenath GRank #8,268 · 225 reputationPosted May 25, 2011, 7:15 AM EDT
<
authentication mode="Windows" />Suthish NairRank #92 · 22.8K reputationPosted May 25, 2011, 10:22 AM EDT
Mahesh ChandRank #1 · 393.3K reputationPosted May 25, 2011, 10:26 AM EDT
Sreenath GRank #8,268 · 225 reputationPosted May 25, 2011, 8:40 PM EDT
Posted May 25, 2011, 8:47 PM EDT
Does the same application is working fine in Windows 7 also?
If possible , can you attach the setting of IIS 6 and IIS 7 ? So that we can easily compare the settings between two version of IIS.
Sreenath GRank #8,268 · 225 reputationPosted May 30, 2011, 11:39 PM EDT
http://www.c-sharpcorner.com/Forums/Thread/123890/site-deployed-in-iis-7-is-always-asking-for-username-and-pas.aspx
any remedy to get rid of this credential request...?