Return to membership from Identity and get weird results for username

Using VS2013 Update 1 I created a new WebForms project. This project uses the "new" Identity membership provider. I didn’t want to use this, so I returned to my membership provider (for more details see Webforms HttpContext.Current.User.Identity.IsAuthenticated always true )

I still have to have something else wrong as soon as the user authenticated with the verification:

System.Web.HttpContext.Current.User.Identity.Name

I get:

"/"

enter image description here

as a result, instead of the name entered by the user at the login through:

Membership.ValidateUser (txtUserName.Text, txtPassword.Text) i.e. why I do not get the value txtUserName.Text instead of /

I checked that SQL is exectuted with

 HttpContext.Current.User.Identity.Name

SQL:

SELECT 
    [Limit1].[C1] AS [C1], 
    [Limit1].[UserName] AS [UserName], 
    [Limit1].[UserId] AS [UserId], 
    [Limit1].[Email] AS [Email], 
    [Limit1].[PasswordQuestion] AS [PasswordQuestion], 
    [Limit1].[Comment] AS [Comment], 
    [Limit1].[IsApproved] AS [IsApproved], 
    [Limit1].[IsLockedOut] AS [IsLockedOut], 
    [Limit1].[CreateDate] AS [CreateDate], 
    [Limit1].[LastLoginDate] AS [LastLoginDate], 
    [Limit1].[LastActivityDate] AS [LastActivityDate], 
    [Limit1].[LastPasswordChangedDate] AS [LastPasswordChangedDate], 
    [Limit1].[LastLockoutDate] AS [LastLockoutDate]
    FROM ( SELECT TOP (1) 
        [Extent1].[UserId] AS [UserId], 
        [Extent1].[UserName] AS [UserName], 
        [Extent1].[LastActivityDate] AS [LastActivityDate], 
        [Extent3].[Email] AS [Email], 
        [Extent3].[PasswordQuestion] AS [PasswordQuestion], 
        [Extent3].[IsApproved] AS [IsApproved], 
        [Extent3].[IsLockedOut] AS [IsLockedOut], 
        [Extent3].[CreateDate] AS [CreateDate], 
        [Extent3].[LastLoginDate] AS [LastLoginDate], 
        [Extent3].[LastPasswordChangedDate] AS [LastPasswordChangedDate], 
        [Extent3].[LastLockoutDate] AS [LastLockoutDate], 
        [Extent3].[Comment] AS [Comment], 
        1 AS [C1]
        FROM   [dbo].[Users] AS [Extent1]
        INNER JOIN [dbo].[Applications] AS [Extent2] ON [Extent1].[ApplicationId] = [Extent2].[ApplicationId]
        INNER JOIN [dbo].[Memberships] AS [Extent3] ON [Extent1].[UserId] = [Extent3].[UserId]
    )  AS [Limit1]

web.config:

<membership defaultProvider="DefaultMembershipProvider">
  <providers>
    <add name="DefaultMembershipProvider" type="System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="MyApp2" />
  </providers>
</membership>
<profile defaultProvider="DefaultProfileProvider">
  <providers>
    <add name="DefaultProfileProvider" type="System.Web.Providers.DefaultProfileProvider, System.Web.Providers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="MyApp2" />
  </providers>
</profile>
<roleManager defaultProvider="DefaultRoleProvider" enabled="true">
  <providers>
    <add name="DefaultRoleProvider" type="System.Web.Providers.DefaultRoleProvider, System.Web.Providers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="MyApp2" />
  </providers>
</roleManager>

" , Identity, - . - , .

, : HOWTO , Identity ?

, "MyApp", , "" , "/" . , MyApp2, web.config .

, . , . . enter image description here

+4
1

, , ?

, ASPX aspx: login. , cookie , , , Memberhip.RedirectFromLogin().

, aspx: . , - .

+3

Source: https://habr.com/ru/post/1542906/