• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 448
  • Last Modified:

Label field is not correctly updating the .text property when data is assigned to it.

I have developed a small application that has a basic login screen for users.  When the user attemtps to login, I assign a label.text property a message stating that the user name does not exist or the password was not correct.  Everything worked fine on my devleopment machine but when I pushed my application over to the server where it will actually live,  the user attemtps to login and the screen just flashes and then returns them back to the login screen.  None of the lables appear to state whether there was a problem with the username or password.  This feature works fine on my development machine but not the server.

My development machine is running Windows XP and Visual Studio 2008.

The server where the app will live is a Windows 2000 server running IIS.  

I have made sure the browser allows cookies, is set to low priority, is a trusted site.....as many things as I could think of and it still has the problem.

Any help on this problem would be greatly appreciated.
protected void btnLogin_Click(object sender, Infragistics.WebUI.WebDataInput.ButtonEventArgs e)
        {
            string physicianNPI;
            int practiceTIN;
            string physicianFname;
            string physicianLname;
            string physicianName;
            bool authenticated;
            string access_role;
            string clinical_pass;
            string portal;
            
 
 
 
 
            RadRelayDataClassDataContext dcRadRelay = new RadRelayDataClassDataContext();
 
            // Query to find the user that is trying to log in, in the user table
 
            var user = from u in dcRadRelay.users
                       where u.USERNAME == tbUserName.Text
                       select new { u };
 
 
 
            if (user.Count() == 0)
            {
                // No Record found in Doctor LookUp 
                lblSuccessUser.Text = "User Not Found - Please Try Again";
                tbUserName.Text = "";
            }
            else
            {
                // Check to see if password is correct
                // 
                foreach (var userrec in user)
                {
                    lblSuccessUser.Text = "User Found";
 
                    if (userrec.u.USERPASS == tbPassword.Text)
                    {
                        lblFailedPass.Text = "Password Success";
 
                        portal = userrec.u.PORTAL;
 
                        
 
                        var practbl = from prac in dcRadRelay.PRACTICEs
                                      where prac.PRACTICE_TIN == userrec.u.PRACTICE_TIN
                                      select new { prac };
 
 
                        if (practbl.Count() == 0)
                        {
                            // No Record found in Practice Table 
                        }
                        else
                        {
                            foreach (var pracrec in practbl)
                            {
                                // Found Practice Record
 
                                practiceTIN = Convert.ToInt32(pracrec.prac.PRACTICE_TIN);
 
                            }
                        }
 
 
 
                        
 
                        var provtbl = from prov in dcRadRelay.PROVIDERs
                                      where prov.PRACTICE_TIN == userrec.u.PRACTICE_TIN
                                      select new { prov };
 
 
                        if (provtbl.Count() == 0)
                        {
                            // No Record found in Practice Table 
                        }
                        else
                        {
                            foreach (var provrec in provtbl)
                            {
                                // Found Practice Record
                                string LoginUser;
 
                                physicianNPI = provrec.prov.PHYSICIAN_NPI;
                                physicianFname = provrec.prov.FIRST_NAME;
                                physicianLname = provrec.prov.LAST_NAME;
                                physicianName = physicianFname + ' ' + physicianLname;
                                access_role = provrec.prov.ACCESS_ROLE;
                                clinical_pass = provrec.prov.CLINICAL_PASS;
 
 
                                authenticated = true;
                                Session.Add("physicianNPI", physicianNPI);
                                Session.Add("physicianName", physicianName);
                                Session.Add("authenticated", authenticated);
                                Session.Add("LoginUser", tbUserName.Text);
                                Session.Add("access_role", access_role);
                                Session.Add("clinical_pass", clinical_pass);
 
                            }
 
 
 
                            string test;
                            test = Session.Contents["LoginUser"].ToString();
 
 
                            if (portal == "Physician")
                            {
                                Response.Redirect("PhysicianPortalMenu.aspx");
                            }
                            if (portal == "Education")
                            {
                                Response.Redirect("SchoolPortal.aspx");
                            }
                            if (portal == "Admin")
                            {
                                Response.Redirect("AdminPortal.aspx");
                            }
                        }
                    }
                    else
                    {
 
                        lblFailedPass.Text = "Invalid Password - Try Again";
                        tbPassword.Text = "";
 
 
 
                    }
                }
            }
        }
    }

Open in new window

0
kwh3856
Asked:
kwh3856
  • 8
  • 5
  • 2
1 Solution
 
guru_samiCommented:
There could be several reasons..
1: Make sure browser accepts cookies
2: If you are using roles make sure they are working properly on Production
3:Also check Forms Authentication is enabled in your web.config i.e. it did not changed somehow while you pushed on production

Put some debugging code:
Place a LoginName and LoginStatus Control on your login page...
Put some Response.Writr or Messagebox to pop up in several places whereever you have lable to see what part of the code is causing the problem...
0
 
Walter RitzelSenior Software EngineerCommented:
Could you show me your complete code behind?
0
 
kwh3856Author Commented:
I will post up my web.config and asp.net code as soon as I get the chance.
 
As far as a I know, I did not have form authentication because I do not know how to do that.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
Walter RitzelSenior Software EngineerCommented:
Good, that clarifies some points. I'm asking to see your full source code because I'm suspecting that you maybe have some kind of code on your Page_Load event that may reset the value of your labels.
0
 
kwh3856Author Commented:
Here is the asp.net code.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="RadRelay35sp1.Login" %>
 
<%@ Register assembly="Infragistics35.WebUI.Misc.v9.1, Version=9.1.20091.1015, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.WebUI.Misc" tagprefix="igmisc" %>
<%@ Register assembly="Infragistics35.WebUI.WebDataInput.v9.1, Version=9.1.20091.1015, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.WebUI.WebDataInput" tagprefix="igtxt" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div style="height: 784px">
    
        
    
        <asp:Panel ID="Panel3" runat="server" 
            
            
            
            style="z-index: 2; left: 232px; top: 19px; position: absolute; height: 343px; width: 592px">
            
            <igmisc:WebPanel ID="WebPanel1" runat="server" 
            
            
            
                style="z-index: 1; left: 35px; top: 58px; position: absolute; height: 190px; width: 521px"><Template><asp:Panel ID="Panel1" runat="server" 
                    style="z-index: 1; left: 84px; top: 62px; position: absolute; height: 19px; width: 95px"><asp:Label ID="lblUserName" runat="server" Text="User Name"></asp:Label></asp:Panel><asp:Panel ID="Panel2" runat="server" 
                    style="z-index: 1; left: 84px; top: 93px; position: absolute; height: 19px; width: 95px"><asp:Label ID="lblPassword" runat="server" Text="Password"></asp:Label></asp:Panel><igtxt:WebTextEdit ID="tbUserName" runat="server" 
                    style="z-index: 1; left: 230px; top: 60px; position: absolute" 
                    Width="100px"></igtxt:WebTextEdit><igtxt:WebTextEdit ID="tbPassword" runat="server" 
                    style="z-index: 1; left: 230px; top: 95px; position: absolute" 
                    PasswordMode="True" Width="100px"></igtxt:WebTextEdit><igtxt:WebImageButton ID="btnLogin" runat="server" onclick="btnLogin_Click" 
                    style="z-index: 1; left: 255px; top: 137px; position: absolute" Text="Login"></igtxt:WebImageButton><asp:Panel ID="Panel6" runat="server" 
                    style="z-index: 1; left: 100px; top: 137px; position: absolute; height: 19px; width: 95px"><asp:Label ID="lblSuccessUser" runat="server" Text=""></asp:Label></asp:Panel><asp:Panel 
                ID="Panel7" runat="server" 
                    
                style="z-index: 1; left: 381px; top: 136px; position: absolute; height: 19px; width: 95px"><asp:Label ID="lblFailedPass" runat="server" Text=""></asp:Label></asp:Panel></Template></igmisc:WebPanel>
            
            
            
            
        </asp:Panel>
    
        <asp:Panel ID="Panel4" runat="server" 
            style="z-index: 1; left: 10px; top: 15px; position: absolute; height: 127px; width: 785px">
            
            <img src="Images/Aqua%20Blue%20Background-2.jpg" height="700" width="1018" /><asp:Panel 
                ID="Panel5" runat="server" 
                
                
                
                
                
                
                style="z-index: 1; left: 794px; top: 318px; position: absolute; height: 188px; width: 275px">
                
                
                
                <img alt="" height="156" src="Images/logo1-small-200-matte.png" width="200" /></asp:Panel>
            
            
            
            
            
        </asp:Panel>
    
    </div>
    </form>
</body>
</html>

Open in new window

0
 
kwh3856Author Commented:
Sorry, here is the complete C# code.
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
 
namespace RadRelay35sp1
{
    public partial class Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
 
        }
 
        protected void btnLogin_Click(object sender, Infragistics.WebUI.WebDataInput.ButtonEventArgs e)
        {
            string physicianNPI;
            int practiceTIN;
            string physicianFname;
            string physicianLname;
            string physicianName;
            bool authenticated;
            string access_role;
            string clinical_pass;
            string portal;
            
 
 
 
 
            RadRelayDataClassDataContext dcRadRelay = new RadRelayDataClassDataContext();
 
            // Query to find the user that is trying to log in, in the user table
 
            var user = from u in dcRadRelay.users
                       where u.USERNAME == tbUserName.Text
                       select new { u };
 
 
 
            if (user.Count() == 0)
            {
                // No Record found in Doctor LookUp 
                lblSuccessUser.Text = "User Not Found - Please Try Again";
                tbUserName.Text = "";
            }
            else
            {
                // Check to see if password is correct
                // 
                foreach (var userrec in user)
                {
                    lblSuccessUser.Text = "User Found";
 
                    if (userrec.u.USERPASS == tbPassword.Text)
                    {
                        lblFailedPass.Text = "Password Success";
 
                        portal = userrec.u.PORTAL;
 
                        // Determine what PRACTICE the user works for 
                        // Use the PracticeTIN to match the two together
 
                        var practbl = from prac in dcRadRelay.PRACTICEs
                                      where prac.PRACTICE_TIN == userrec.u.PRACTICE_TIN
                                      select new { prac };
 
 
                        if (practbl.Count() == 0)
                        {
                            // No Record found in Practice Table 
                        }
                        else
                        {
                            foreach (var pracrec in practbl)
                            {
                                // Found Practice Record
 
                                practiceTIN = Convert.ToInt32(pracrec.prac.PRACTICE_TIN);
 
                            }
                        }
 
 
 
                        // Determine which PROVIDER the user works for 
                        // Use the PracticeTIN to match the two together
 
                        var provtbl = from prov in dcRadRelay.PROVIDERs
                                      where prov.PRACTICE_TIN == userrec.u.PRACTICE_TIN
                                      select new { prov };
 
 
                        if (provtbl.Count() == 0)
                        {
                            // No Record found in Practice Table 
                        }
                        else
                        {
                            foreach (var provrec in provtbl)
                            {
                                // Found Practice Record
                                string LoginUser;
 
                                physicianNPI = provrec.prov.PHYSICIAN_NPI;
                                physicianFname = provrec.prov.FIRST_NAME;
                                physicianLname = provrec.prov.LAST_NAME;
                                physicianName = physicianFname + ' ' + physicianLname;
                                access_role = provrec.prov.ACCESS_ROLE;
                                clinical_pass = provrec.prov.CLINICAL_PASS;
 
 
                                authenticated = true;
                                Session.Add("physicianNPI", physicianNPI);
                                Session.Add("physicianName", physicianName);
                                Session.Add("authenticated", authenticated);
                                Session.Add("LoginUser", tbUserName.Text);
                                Session.Add("access_role", access_role);
                                Session.Add("clinical_pass", clinical_pass);
 
                            }
 
 
 
                            string test;
                            test = Session.Contents["LoginUser"].ToString();
 
 
                            if (portal == "Physician")
                            {
                                Response.Redirect("PhysicianPortalMenu.aspx");
                            }
                            if (portal == "Education")
                            {
                                Response.Redirect("SchoolPortal.aspx");
                            }
                            if (portal == "Admin")
                            {
                                Response.Redirect("AdminPortal.aspx");
                            }
                        }
                    }
                    else
                    {
 
                        lblFailedPass.Text = "Invalid Password - Try Again";
                        tbPassword.Text = "";
 
 
 
                    }
                }
            }
        }
    }
}

Open in new window

0
 
kwh3856Author Commented:
Here is the web config file running on the server.
<?xml version="1.0"?>
<configuration>
  <configSections>
    <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
        <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
        <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
          <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" />
          <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
          <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
          <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
        </sectionGroup>
      </sectionGroup>
    </sectionGroup>
    <section name="infragistics.web" type="System.Configuration.SingleTagSectionHandler,System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
  </configSections>
  <infragistics.web enableAppStyling="true" styleSetName="ElectricBlue" styleSetPath="~/ig_res/" />
  <appSettings />
  <connectionStrings>
              
    <add name="Rad_RelayConnectionString" connectionString="Data Source=SVR1;Initial Catalog=Rad Relay; Integrated Security=True" providerName="System.Data.SqlClient" />
  </connectionStrings>
  <system.web>
  
  <identity impersonate="true" userName="RadRelay" password="NotRealPassword" />
  
  
  
  
  
    <!-- 
            Set compilation debug="true" to insert debugging 
            symbols into the compiled page. Because this 
            affects performance, set this value to true only 
            during development.
        -->
    <compilation debug="true" defaultLanguage="c#">
      <assemblies>
        <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
        <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
        <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
        <add assembly="Infragistics35.WebUI.UltraWebListbar.v9.1, Version=9.1.20091.1015, Culture=neutral, PublicKeyToken=7DD5C3163F2CD0CB" />
        <add assembly="Infragistics35.WebUI.Shared.v9.1, Version=9.1.20091.1015, Culture=neutral, PublicKeyToken=7DD5C3163F2CD0CB" />
        <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
        <add assembly="Infragistics35.WebUI.Misc.v9.1, Version=9.1.20091.1015, Culture=neutral, PublicKeyToken=7DD5C3163F2CD0CB" />
        <add assembly="Infragistics35.WebUI.UltraWebNavigator.v9.1, Version=9.1.20091.1015, Culture=neutral, PublicKeyToken=7DD5C3163F2CD0CB" />
        <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
        <add assembly="Infragistics35.WebUI.WebDataInput.v9.1, Version=9.1.20091.1015, Culture=neutral, PublicKeyToken=7DD5C3163F2CD0CB" />
        <add assembly="Infragistics35.WebUI.UltraWebGrid.v9.1, Version=9.1.20091.1015, Culture=neutral, PublicKeyToken=7DD5C3163F2CD0CB" />
        <add assembly="Infragistics35.Web.v9.1, Version=9.1.20091.1015, Culture=neutral, PublicKeyToken=7DD5C3163F2CD0CB" />
        <add assembly="Infragistics35.WebUI.WebDateChooser.v9.1, Version=9.1.20091.1015, Culture=neutral, PublicKeyToken=7DD5C3163F2CD0CB" />
      </assemblies>
    </compilation>
    <!--
            The <authentication> section enables configuration 
            of the security authentication mode used by 
            ASP.NET to identify an incoming user. 
        -->
    <authentication mode="Windows" />
    <!--
            The <customErrors> section enables configuration 
            of what to do if/when an unhandled error occurs 
            during the execution of a request. Specifically, 
            it enables developers to configure html error pages 
            to be displayed in place of a error stack trace.
 
        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors>
        -->
    <pages>
      <controls>
        <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      </controls>
    </pages>
    <httpHandlers>
      <remove verb="*" path="*.asmx" />
      <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" />
    </httpHandlers>
    <httpModules>
      <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    </httpModules>
  </system.web>
  <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
        <providerOption name="CompilerVersion" value="v3.5" />
        <providerOption name="WarnAsError" value="false" />
      </compiler>
    </compilers>
  </system.codedom>
  <!-- 
        The system.webServer section is required for running ASP.NET AJAX under Internet
        Information Services 7.0.  It is not necessary for previous version of IIS.
    -->
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <modules>
      <remove name="ScriptModule" />
      <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    </modules>
    <handlers>
      <remove name="WebServiceHandlerFactory-Integrated" />
      <remove name="ScriptHandlerFactory" />
      <remove name="ScriptHandlerFactoryAppServices" />
      <remove name="ScriptResource" />
      <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    </handlers>
  </system.webServer>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

Open in new window

0
 
guru_samiCommented:
you have  <authentication mode="Windows" />
You are using Windows authentication and still providing login form to the users.

Change that to  <authentication mode="Forms" />

Now For Trouble shooting purpose add LoginName control to your Login page and see what value it is displaying.




0
 
kwh3856Author Commented:
Thank you.  I will try that.  Can you tell me exactly how the <authentication mode="Forms" />
 works.  Also, I have never used the LoginName control.  What does that do and when should I use it versus how I have my login setup right now.
 
Thanks
Kenny
 
0
 
guru_samiCommented:
The Introduction Tutorials here: http://www.asp.net/learn/security/
will explain about Forms Authentication.
Also check this: http://www.codedigest.com/Articles/ASPNET/112_Implementing_Forms_Authentication_in_ASPNet_20.aspx

LoginName Control will display nothing more than the Current logged-in user name. This will only display the username if you are using Forms or Windows authentication.
0
 
kwh3856Author Commented:
I tried <authentication mode="Forms" />
 but that still do not work.  When I added the login name it showed me my windows login when I had the mode set to windows.  When I set it to forms, it show nothing for the login.  Any ideas?
Could this be a setting in IIS?
Thanks
Kenny
 
0
 
guru_samiCommented:
Ok so now when you set it to Forms mode and then try to login...is your lable value being set or not?
0
 
guru_samiCommented:
Yes...loginName will show empty value ...since the user is not logged-in and you have to set FormsAuthentication Cookie upon login...
After this statement in your LoginButton Click code...
 ---- Session.Add("clinical_pass", clinical_pass);
Add this line:
----- FormsAuthentication.SetAuthCookie(tbUserName.Text, false);

Then See if you are redirect to proper page or not...


0
 
kwh3856Author Commented:
I will try that as soon as possible and let you know.
 
Thanks
Kenny
 
0
 
kwh3856Author Commented:
guru sami,
I finally figured it out.  I had moved my application from development to production and when I did I did not realize about the data that I needed to setuip in the other tables.  I had only setup a user record in the user table but did not setup records in the other table.  Consequently, it could not find a record in the practice table and therefore never hit the else statement that sent the user to the menu.  I wanted to award you the points because you enlightened me to a technology I had no idea about.  Since you told me about forms authentication I have been reading up on it and plan on implementing it in my application.  Thank you for all your help.

Thanks
Kenny
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 8
  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now