473,461 Members | 1,925 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Errors in Visual Studio register.aspx file

Hello

I am getting the following compilation error in my register.aspx file:

C30456: 'GetOwinContext' is not a member of 'System.Web.HttpContext'.

This is my code:

Expand|Select|Wrap|Line Numbers
  1.  Protected Sub CreateUser_Click(sender As Object, e As EventArgs)
  2.         Dim userName As String = Email.Text
  3.         Dim manager = Context.GetOwinContext().GetUserManager(Of ApplicationUserManager)()
  4.         Dim signInManager = Context.GetOwinContext().Get(Of ApplicationSignInManager)()
  5.         Dim user = New ApplicationUser() With {.userName = userName, .Email = userName}
  6.         Dim result = manager.Create(user, Password.Text)
  7.         If result.Succeeded Then
  8.             ' For more information on how to enable account confirmation and password reset please visit http://go.microsoft.com/fwlink/?LinkID=320771
  9.             ' Dim code = manager.GenerateEmailConfirmationToken(user.Id)
  10.             ' Dim callbackUrl = IdentityHelper.GetUserConfirmationRedirectUrl(code, user.Id, Request)
  11.             ' manager.SendEmail(user.Id, "Confirm your account", "Please confirm your account by clicking <a href=""" & callbackUrl & """>here</a>.")
  12.  
  13.             signInManager.SignIn(user, isPersistent:=False, rememberBrowser:=False)
  14.             IdentityHelper.RedirectToReturnUrl(Request.QueryString("ReturnUrl"), Response)
  15.         Else
  16.             ErrorMessage.Text = result.Errors.FirstOrDefault()
  17.         End If
  18.     End Sub
The following, from the above code, are underlined in red:

Expand|Select|Wrap|Line Numbers
  1. Context.GetOwinContext
Error: Not a member of httpContext

Expand|Select|Wrap|Line Numbers
  1. IdentityHelper
Error: it is not declared.

At the top of my file, the following are underlined in VS 2017 in green as not being necessary:

Expand|Select|Wrap|Line Numbers
  1. Imports Microsoft.AspNet.Identity
  2. Imports Microsoft.AspNet.Identity.EntityFramework
  3. Imports Microsoft.AspNet.Identity.Owin
  4. Imports Owin
Where do I go from here, please?

Thanks!
Jan 19 '19 #1
1 6450
SioSio
272 256MB
Are you writing like this?
Dim Context As HttpContext

If so, it will look like
Context.Current.GetOwinContext
Dec 19 '19 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

33
by: John Timbers | last post by:
I'd like to purchase Visual C# .Net for learning purposes only since it's a lot cheaper than Visual Studio (note that I'm a very experienced C++ developer). Can someone simply clarify the basic...
3
by: Erich | last post by:
Hello! I didnt find this error in the MS documentation, but struggling with it since a few days. Before I lost all my hope, let me ask you for a hint on that, so I might come out of that...
0
by: | last post by:
Hello! I have opened a aspx file with visual studio. I see a yellow line and the run etc buttons grayed out. Why is that? Regards Bruno x--------------------- <%@ Page Language="VB"...
2
by: cameron | last post by:
This is probably off topic, so please feel free to redirect me to proper news group, I am wondering if you can enable the XML comments in Visual Studio for other file types. I have written a...
4
by: John Mick | last post by:
Hi, I have renamed aspx to .ret and would like visual studio to recognize .ret file as an aspx file recognize = show designer, intellisense, group up with corresponding codebehind in solution...
4
by: rohinichandrap | last post by:
Hi , I have quite a few questions about Visual Studio :Net 2003 and clear case Could anyone please help me with the answers. I have converted a workspace abc.dsw from visual studio 6 to...
12
by: Nathan Sokalski | last post by:
I recently upgraded to from Visual Studio .NET 2003 to Visual Studio .NET 2005. In Visual Studio .NET 2003 when I would select 'Build' it would add a *.dll with the name of the Project to a /bin/...
10
by: Steve | last post by:
I am trying to create a DLL in Visual Studio 2005-Visual Basic that contains custom functions. I believe I need to use COM interop to allow VBA code in Excel 2002 to access it. I've studied...
3
by: =?Utf-8?B?UGhpbCBKb2huc29u?= | last post by:
Hi, This is an issue that happens to me and everybody else I know and I've never found a way around it. In Visual Studio (currently using 2003 but the same has happened for me in 2005 and...
4
by: dseals22 | last post by:
I am confuse about why Visual Studio 2017 doesn't let me add HTML elements into the Default.aspx, but what I do know is that under the Solution Explorer, I see master page and apparently they are...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.