Just a note.
This
if (lStrUsers.Trim().ToLower() == lStrCurrentUser.Trim().ToLower())
{
btnInovisService.Enabled = true;
}
else
{
btnInovisService.Enabled = false;
}
is exactly the same as
btnInovisService.Enabled = lStrUsers.Trim().ToLower() == lStrCurrentUser.Trim().ToLower()
Only the last fragment is correct. You assign Boolean immediate constant
true
or
false
on condition which is already a Boolean value. There are no situation when you need it.
Another problem is using some immediate constants like "ServiceAuthUsers". It makes your code unsupportable. In particular, you never need the constant ""; always use string.Empty.
There is not such event
Page_Load
; this is just a name of the method. When asking questions you should always indicate that you're handling some event like
System.Web.UI.Page.Load
(or
PreLoad
). The name of the handler can be anything. Too bad you're using auto-generated name which violates (good) Microsoft naming conventions. (Yes, Microsoft generated names do not pass Microsoft check with FxCop as they violate the naming conventions.) You should better rename all auto-generated declaration to something semantic.
This per se won't help you to solve your problem. I only wanted to note that with such level of understanding of basic programming techniques you can expect all kinds of troubles. Sorry, I did not want to disappoint you, I just wanted to help you to tighten up you very basic programming skills before getting to something more difficult. It will come soon; you only want to pay close attention to it.
—SA