daveharney (13) [Avatar] Offline
A pretty easy chapter and I got a good understanding of how Identity works. However, one topic that still confuses me is the “returnUrl” that is used heavily in the Account and Manage controllers. Following the use of this string with the debugger didn’t provide much insight. For example, if I use the default template and logon while in the Contact page, I don’t return to that page after being logged on. The returnUrl string always seems to be null? Some insight would be appreciated.

Adding Identity to an existing project is definitely complicated and time consuming. However, the tutorial here does make it workable. The trick of creating a temp project with the same name is a great idea! A couple of observations:

- Copying the temp project code is best done from the File Explorer – not Visual Studio.

- I had to delete the ApplicationUser from Models and put it in Data to conform with the author’s Recipe sample project.

- _ViewImports needs the Data Using line (now in the sample code)

- Page 435 perhaps remind that DB Update is also needed after the migration

- The Account and Manage controllers need to be tweaked for returning to the Recipe index page after each method.
Andrew Lock (25) [Avatar] Offline
Hi Dave,

You might find that the ReturnUrl makes more sense after chapter 15. It is typically used when a page is requested that you need to be logged in to access. For example, click the "Create Recipe" button when not logged in on chapter 15, and you'll see the current page is passed in the returnUrl parameter. Now, it would be perfectly possible to set the returnUrl based on the page you're on, that's just not the way the templates work smilie

Thanks for the notes on your expereince - I'll make sure to add clarification where necessary smilie