Hello
I am getting the following compilation error in my register.aspx file:
C30456: 'GetOwinContext ' is not a member of 'System.Web.Htt pContext'.
This is my code:
The following, from the above code, are underlined in red:
Error: Not a member of httpContext
Error: it is not declared.
At the top of my file, the following are underlined in VS 2017 in green as not being necessary:
Where do I go from here, please?
Thanks!
I am getting the following compilation error in my register.aspx file:
C30456: 'GetOwinContext ' is not a member of 'System.Web.Htt pContext'.
This is my code:
Code:
Protected Sub CreateUser_Click(sender As Object, e As EventArgs) Dim userName As String = Email.Text Dim manager = Context.GetOwinContext().GetUserManager(Of ApplicationUserManager)() Dim signInManager = Context.GetOwinContext().Get(Of ApplicationSignInManager)() Dim user = New ApplicationUser() With {.userName = userName, .Email = userName} Dim result = manager.Create(user, Password.Text) If result.Succeeded Then ' For more information on how to enable account confirmation and password reset please visit http://go.microsoft.com/fwlink/?LinkID=320771 ' Dim code = manager.GenerateEmailConfirmationToken(user.Id) ' Dim callbackUrl = IdentityHelper.GetUserConfirmationRedirectUrl(code, user.Id, Request) ' manager.SendEmail(user.Id, "Confirm your account", "Please confirm your account by clicking <a href=""" & callbackUrl & """>here</a>.") signInManager.SignIn(user, isPersistent:=False, rememberBrowser:=False) IdentityHelper.RedirectToReturnUrl(Request.QueryString("ReturnUrl"), Response) Else ErrorMessage.Text = result.Errors.FirstOrDefault() End If End Sub
Code:
Context.GetOwinContext
Code:
IdentityHelper
At the top of my file, the following are underlined in VS 2017 in green as not being necessary:
Code:
Imports Microsoft.AspNet.Identity Imports Microsoft.AspNet.Identity.EntityFramework Imports Microsoft.AspNet.Identity.Owin Imports Owin
Thanks!
Comment