ASP NET Web API user registration

ASP NET Web API user registration

In this video we will discuss implementing new user registration page. This is continuation to Part 20. Please watch Part 20 from ASP.NET Web API tutorial before proceeding.

Text version of the video
http://csharp-video-tutorials.blogspot.com/2016/11/aspnet-web-api-user-registration.html

Healthy diet is very important both for the body and mind. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking our YouTube channel. Hope you can help.
https://www.youtube.com/channel/UC7sEwIXM_YfAMyonQCrGfWA/?sub_confirmation=1

Slides
http://csharp-video-tutorials.blogspot.com/2016/11/aspnet-web-api-user-registration_29.html

All ASP .NET Web API Text Articles and Slides
http://csharp-video-tutorials.blogspot.com/2016/09/aspnet-web-api-tutorial-for-beginners.html

All ASP .NET Web API Videos

All Dot Net and SQL Server Tutorials in English
https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd

All Dot Net and SQL Server Tutorials in Arabic
https://www.youtube.com/c/KudvenkatArabic/playlists

50 Comments

  1. Saurabh Kumar on August 15, 2021 at 9:19 pm

    For those who are getting error like 400 or 404.Please check the below.
    1.Make sure you enter password with min 6 letter with one upper case one special character.
    2.Do check the url you are providing .
    Hope it helps.



  2. Shankar Narwal on August 15, 2021 at 9:19 pm

    sir , i am getting error 405 the server does not support Get method… yet i am using POST method.
    i am using visual studio 2013. please help



  3. Tongli Wang on August 15, 2021 at 9:21 pm

    Thank you, Kudenkat, for the best tutorial videos on this topic. Everything is very clear and easy to follow. I have one question. How to add additional columns in the Registration form? I hope to include "Country" for example.



  4. Vincent Malinga on August 15, 2021 at 9:23 pm

    Guys Please Help, the tutorial link where he was Creating the AccountController please



  5. Hardeep singh Negi on August 15, 2021 at 9:25 pm

    getting error
    $(‘#btnRegister’).click(function () {
    var model = new Object();
    model.Email = $(‘#signup_email’).val();
    model.Password = $(‘#signup_password’).val();
    model.ConfirmPassword = $(‘#signup_confirm_password’).val();
    $.ajax({

    url: ‘api/Account/Register’,
    method: ‘POST’,
    contentType: "application/json",
    data: JSON.stringify(model),
    success: function () {

    $(‘#successmodal’).modal();
    },
    error: function (jqXHR) {
    $(‘#divErrorText’).text(jqXHR.responseText);
    $(‘#divError’).show(‘fade’);

    }
    });
    why this error
    :{"Message":"The request is invalid.","ModelState":{"model.Email":["The Email field is required."],"model.Password":["The Password must be at least 6 characters long.","The Password field is required."],"model.ConfirmPassword":["The password and confirmation password do not match."]}}



  6. tayyab mushtaq on August 15, 2021 at 9:25 pm

    why are you wasting too much time on bootstraping brother .. why can’t you get straight to the point.



  7. Arunav Dash on August 15, 2021 at 9:27 pm

    Hi
    Iam getting below error while running the application.Can anyone please suggest how to resolve the issue
    {"Message":"No HTTP resource was found that matches the request URI ‘http://localhost:51723/api/Account/Register’.","MessageDetail":"No type was found that matches the controller named ‘Account’."}



  8. Dat Boi on August 15, 2021 at 9:28 pm

    Instead of using the script "jquery-1.10.2.min.js" I found that my version of VS (2017) uses "jquery-3.3.1.min.js".



  9. Brian Walsh on August 15, 2021 at 9:29 pm

    how do you change it to connect with another database and send the register details there? and how do you keep track of the current person logged in say you want to add a list of clients that will belong to the user logged in



  10. Test Payman on August 15, 2021 at 9:30 pm

    How is this email, password, confirmPassword of jQuery Ajax is being exactly mapped to Email, Password, ConfirmPassword of C# models?
    $.ajax({
    url: ‘/api/account/register’,
    method: ‘POST’,
    data: {
    email: $(‘#txtEmail’).val(),
    password: $(‘#txtPassword’).val(),
    confirmPassword: $(‘#txtConfirmPassword’).val()
    },

    })
    Thank you for the kind response in advance.



  11. Eshwar MMM on August 15, 2021 at 9:30 pm

    Thank you Venkat sir for your Tutorial. But am facing a problem that when i click on register button its taking time and database is not creating and its throw some error but error text is empty, when i put break point in Register Method and checked Model is coming correctly but while saving that information control goes to dispose method, I dont know why? Please solve this Issue.

    Thank you



  12. leonardo spectrum on August 15, 2021 at 9:31 pm

    I have next error:
    POST http://localhost:62161/api/Account/Register 404 (Not Found)
    Can you help?



  13. Vatan Soni on August 15, 2021 at 9:31 pm

    Many of us have same issue here:
    mdf file is not getting created, (i have done show hidden file). Please help



  14. Fernando MF on August 15, 2021 at 9:34 pm

    thank you kind sir



  15. Carl Hlazo on August 15, 2021 at 9:34 pm

    Venkat.
    Thank you very much for your tutorials. Your presentation is clear, concise and you make it very easy to follow and learn . I have benefited tremendously from your tutorials and I recommended them to all my colleagues. Please keep up this outstanding work.



  16. Amsh Tiwari on August 15, 2021 at 9:35 pm

    can any one help me where is code for AccountController



  17. krishna devwanshi on August 15, 2021 at 9:35 pm

    Hi,My defaultConnection is not able to create the database and is not showing in the app data folder even i click show all



  18. Clark Inocalla on August 15, 2021 at 9:36 pm

    By disabling the JavaScript on that page, would that cause a privacy breach? Should the API be called in the server side?



  19. pankaj singh on August 15, 2021 at 9:36 pm

    Membership Database is not get created after clicking on Register button.



  20. Laxmi Ravindra Katti on August 15, 2021 at 9:37 pm

    Hello sir i am not getting any hidden files in app_data folder sir



  21. RAFEEQ MOHAMMAD on August 15, 2021 at 9:37 pm

    I have done exactly the same but after completion I am not able to get click event work and get data saved.



  22. Nidhi Patel on August 15, 2021 at 9:38 pm

    It is really helpful but can you please make one more video in continuation like with insert, delete and edit buttons on the employee list. So, that we can add a new employee, modify the information by using edit button and even if we don’t want any employee’s name in the records we can delete that. Thank you



  23. Akhil Nambiar on August 15, 2021 at 9:38 pm

    mdf is not creating



  24. mayank kaushik on August 15, 2021 at 9:42 pm

    I wan to know if I am not using membership of dotnet and have my own tables/AD authentication/Gmail auth bow can I use OWIN for that? or is it like that OWIN works only with dotnet membership thing.



  25. amlanbdey on August 15, 2021 at 9:45 pm

    Thanks a lot Venkat Sir, really helpful… I am new , tried to understand one thing: if we are supplying data from the html to the RegisterBindingModel class, then isn’t it the property name should match exactly with the names which we are mentioning in the Ajax call (data: section)? They look pascal-cased(ConfirmPassword) in the class, but camel-cased(confirmPassword) inside the ajax, how are they mapping the data then, if anyone can kindly explain… thanks



  26. Rohit Sakalle on August 15, 2021 at 9:45 pm

    In order to get Account controller see previous video. You need to select Individual user while selecting project template.



  27. Aber Abou-Rahma on August 15, 2021 at 9:46 pm

    Thanks!. In the ajax success parameter add $(‘#divError’).hide(); to hide possible previous error’s div



  28. Sheikh S. Mahmud on August 15, 2021 at 9:46 pm

    Hi Mr Venkat,
    Thanks for sharing the videos! Your tutorials work like a charm. But at 18:02, I am facing sql server instance issue. Now I recall that we configured ado.net model to point to the local database which is in my case my server instance SHEIKH-PC and points to existing employee db database. The connectionstrings are correct. I followed from last video to now and I made sure all steps are ok, with no spelling mistakes on the jquery code and html, and the register form is just like yours. But then when I add new user, I wait for the POST request for long time and then it shows the red error message box underneath saying ‘ a network related instance blah blah’ typical sql connection error. Am I missing something? Did you add a prior database before this for memberships? Or do you have a separate .mdf file or some downloadable database script that you incorporated in your local sql server prior to making this and the prev videos? Let me know and thanks and have a great day 🙂



  29. Merajul Hasan on August 15, 2021 at 9:46 pm

    Hi Sir, I want token authentication based on the mobile number, So is there a way to override this userRegistrationModel? or could I implement a custom token authentication similar to this default token authentication but with my table structure?



  30. Sashi Dhar on August 15, 2021 at 9:47 pm

    Why the content type is not specified for the Ajax call?



  31. Srilakshmi A on August 15, 2021 at 9:47 pm

    Thanks alot Sir, its really helpful for me ,I tried this to implement new User registration page am able to do but the issue is am not able to click on "register" button.Can you help me out on this issue.



  32. Swing Trade on August 15, 2021 at 9:49 pm

    I fixed this problem .. i missed the assembly Microsoft.AspNet.Identity.owen due to which i got this error



  33. WORLANYO ADOM on August 15, 2021 at 9:50 pm

    Can you please provide the Account Controller link? How did you create that?



  34. bhuvaneswari dhanapal on August 15, 2021 at 9:50 pm

    i dont have the mdf file created which is created to save user registeration details.can anyone help with the issue ?



  35. Sarada Tandukar on August 15, 2021 at 10:01 pm

    when was the account controller created?where is the code



  36. Swing Trade on August 15, 2021 at 10:01 pm

    Hello Sir … when i tried i got this error {"Message":"The request is invalid.","ModelState":{"":["User name test22@gmail.com is invalid, can only contain letters or digits."]}} ..please help me
    Thank you



  37. Nafiz Mahamud on August 15, 2021 at 10:02 pm

    I can`t find the account controller in my project….plz anyone sent me the code of account controller….



  38. Nika Sanaia on August 15, 2021 at 10:03 pm

    On register I have message {"Message":"The request is invalid.","ModelState":{"model.ConfirmPassword":["The password and confirmation password do not match."]}} my password are same …



  39. Arslan Rajpoot on August 15, 2021 at 10:03 pm

    i want to return the all data of user where he/she login
    how this is possible ?



  40. usman on August 15, 2021 at 10:05 pm

    Simple and to the point…
    Good work!



  41. Shazia Hussain on August 15, 2021 at 10:06 pm

    I did all of it but these identity tables didnt appear



  42. Mustafa Shahid on August 15, 2021 at 10:08 pm

    I am getting the same error, again and again, 400 bad request in Browser console



  43. Narendar Singh on August 15, 2021 at 10:13 pm

    Great Sir,I am grateful to you.



  44. Michael Howard on August 15, 2021 at 10:13 pm

    You deserve to be paid for this tutorial. It is better than most Udemy and Lynda tutorials. Can I donate?



  45. Klevis Xhakollari on August 15, 2021 at 10:14 pm

    great tutorial, thnx a lot



  46. abhinav tripathi on August 15, 2021 at 10:14 pm

    you have not shown the code of account controller. also did not understand from where you have got modal.



  47. DIDAR SINGH on August 15, 2021 at 10:14 pm

    hello sir i just want know that if .dmf isn’t formed in App_Data what to do than



  48. Martin daiello on August 15, 2021 at 10:17 pm

    Hi.
    My app_data folder is empty, and I have inserted a new user successfully. I dont know where is the problem, I followed all the steps of the video.



  49. Amit Kavinkar on August 15, 2021 at 10:19 pm

    Sir can me helps ,I am write complete code for visual studio 2017 and follow all process for code but do not know how to create AccountController because this video not completetly view for created AccountController and App_Data folder database Please ans me!



  50. Suresh Kumar on August 15, 2021 at 10:19 pm

    what if i want to add more fields like mobile number and name in registration page???