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
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.
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
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.
Guys Please Help, the tutorial link where he was Creating the AccountController please
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."]}}
why are you wasting too much time on bootstraping brother .. why can’t you get straight to the point.
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’."}
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".
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
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.
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
I have next error:
POST http://localhost:62161/api/Account/Register 404 (Not Found)
Can you help?
Many of us have same issue here:
mdf file is not getting created, (i have done show hidden file). Please help
thank you kind sir
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.
can any one help me where is code for AccountController
Hi,My defaultConnection is not able to create the database and is not showing in the app data folder even i click show all
By disabling the JavaScript on that page, would that cause a privacy breach? Should the API be called in the server side?
Membership Database is not get created after clicking on Register button.
Hello sir i am not getting any hidden files in app_data folder sir
I have done exactly the same but after completion I am not able to get click event work and get data saved.
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
mdf is not creating
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.
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
In order to get Account controller see previous video. You need to select Individual user while selecting project template.
Thanks!. In the ajax success parameter add $(‘#divError’).hide(); to hide possible previous error’s div
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 🙂
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?
Why the content type is not specified for the Ajax call?
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.
I fixed this problem .. i missed the assembly Microsoft.AspNet.Identity.owen due to which i got this error
Can you please provide the Account Controller link? How did you create that?
i dont have the mdf file created which is created to save user registeration details.can anyone help with the issue ?
when was the account controller created?where is the code
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
I can`t find the account controller in my project….plz anyone sent me the code of account controller….
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 …
i want to return the all data of user where he/she login
how this is possible ?
Simple and to the point…
Good work!
I did all of it but these identity tables didnt appear
I am getting the same error, again and again, 400 bad request in Browser console
Great Sir,I am grateful to you.
You deserve to be paid for this tutorial. It is better than most Udemy and Lynda tutorials. Can I donate?
great tutorial, thnx a lot
you have not shown the code of account controller. also did not understand from where you have got modal.
hello sir i just want know that if .dmf isn’t formed in App_Data what to do than
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.
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!
what if i want to add more fields like mobile number and name in registration page???