Part 2 - Complete login and registration system in ASP.NET MVC application

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 ก.ย. 2024
  • In the previous video (Part 1: www.youtube.co...) of this article "Complete Login and registration system in asp.net MVC application" We have already done the Part 1: Registration page with email validation & password hashing from where a user will get a verification email in his/her email ID. Here in this video, we will create email verification page for account verification, login page with remember me option & Logout page.
    Read More: www.dotnetaweso...
  • แนวปฏิบัติและการใช้ชีวิต

ความคิดเห็น • 98

  • @nayandey9112
    @nayandey9112 6 ปีที่แล้ว +1

    This tutorial is really helpfull for the beginner like me.
    Thank you sourav mondal Vai

  • @koustavshee761
    @koustavshee761 3 ปีที่แล้ว

    thank you soo much
    without this I will be unable do my project

  • @rafishagha813
    @rafishagha813 6 ปีที่แล้ว +2

    Aoa. MY Application is not redirecting to login url

  • @AETemplate
    @AETemplate 6 ปีที่แล้ว

    THANK YOU SO MUCH .. Really helpful .. Works Perfectly .

  • @chandrasekhar-yx1ci
    @chandrasekhar-yx1ci 4 ปีที่แล้ว

    Dude,your the best one of all.

  • @YasirAli-fg1bg
    @YasirAli-fg1bg 5 ปีที่แล้ว

    I am facing problem an exception occur on this line
    var v = dc.Users.Where(a => a.EmailID == login.EmailID).FirstOrDefault();
    when i login with an email which is not already regitered, how to get rid of this exception and display a proper error message

  • @dennyd.7467
    @dennyd.7467 6 ปีที่แล้ว +1

    did anyone manage to successfully log in a registered user? After I log in, I get redirected to home page but after "Welcome..." there is just blank space and no log out link either... Any ideas what the issue is or how to fix? :(
    Edit: I do not use [Authorize] in the Index() method of the HomeController; but if i do, the error I get after attempting to log in is "Invalid login attempt".

  • @dndnegy73
    @dndnegy73 5 ปีที่แล้ว

    I don’t understand what is the string ReturnUrkl is? How will we redirect to it?

  • @juanefectivo
    @juanefectivo 7 ปีที่แล้ว

    Thank you so much!!! Great tutorial!!

  • @NetSpeakBD
    @NetSpeakBD 6 ปีที่แล้ว

    It's a good tutorial ever . but i am facing a problem during login . during registration i use hash password . and when i am going to login i made provided password as hash password.by a same method which i used during registration . and then i compared with this hash password with saved hash password . but it seems that the password don't matched. though i used correct password.
    i invent there are a problem that is . when i am going to login with the method of password hashing it provide me different hash code than registration time. though i used same password in the both registration time and login time.
    i don't understand what is the problem . please let me know about the mistake of the code.
    Regards
    Rakib

  • @WaqarAhmed-tj7zt
    @WaqarAhmed-tj7zt 6 ปีที่แล้ว

    Hi Dear thank you so much for your good effort,
    I asked 1 question:
    My code is running and successfully login and registration done but prob is that when send link on your email address so I will click on activation link or not account is already created, and successfully login, and second is that not showing any error message or created message please ans my question , waiting and thanx in advance.

  • @محمدالدريبي-ك9ح
    @محمدالدريبي-ك9ح 5 ปีที่แล้ว

    In the min 20:25 why should we encrypt the ticket???

  • @கமலக்கண்ணன்நா
    @கமலக்கண்ணன்நா 6 ปีที่แล้ว

    Hi sourav i am getting "HTTP Error 401.0 - Unauthorized" error when i ran the application after this part. After completing the first part video it was running good.

  • @danbrls9675
    @danbrls9675 6 ปีที่แล้ว

    A very nice tutorial!

  • @shivramhiwalkar3929
    @shivramhiwalkar3929 5 ปีที่แล้ว

    Hey I'm not getting the page as User registration and it is showing no errors?

  • @nilacool3602
    @nilacool3602 7 ปีที่แล้ว

    sir
    please make the session logout. When I click on registration page it open the registration after still login ?
    how could i solve this problem ?
    Thank you

  • @sajedulromy
    @sajedulromy 7 ปีที่แล้ว +3

    Your videos are awesome! Could you make a video series on custom made users role and permission for MVC4?

    • @souravmondal45
      @souravmondal45  7 ปีที่แล้ว

      You can take a look on this th-cam.com/users/edit?o=U&video_id=nmgLMqB_1uA

    • @sajedulromy
      @sajedulromy 7 ปีที่แล้ว

      I have watched the series I was nice. It only covers the authetication part not the roles and permissions part I mean the authorization part. The idea is like, there is should two extra table for 'roles' and 'users_roles' pivot table then according to the roles users are authorized to read/write the pages.

    • @souravmondal45
      @souravmondal45  7 ปีที่แล้ว +2

      Here in part 3 of that series you can see role provider
      th-cam.com/video/viVfYmEuKIk/w-d-xo.html
      www.dotnetawesome.com/2015/06/part3-how-to-implement-custom-forms-authentication-in-aspnet-mvc.html

    • @sajedulromy
      @sajedulromy 7 ปีที่แล้ว

      Thanks! I missed that!

  • @aqibarif7914
    @aqibarif7914 6 ปีที่แล้ว

    My code is not giving any error even it is sending verification email but it is not updating my database. Can you help?

  • @DenIs-vm3wk
    @DenIs-vm3wk 7 ปีที่แล้ว

    Great tutorial. You saved me :)

  • @forzastrikerz
    @forzastrikerz 7 ปีที่แล้ว

    Validation.error occurred in DC.savechanges(); ??? How to rectify

  • @twinklepatel9894
    @twinklepatel9894 4 ปีที่แล้ว

    after log in does not redirect on any page

  • @rafishagha813
    @rafishagha813 6 ปีที่แล้ว

    sourav sir if we didn't click remember methen it doesn't login

  • @tothedust
    @tothedust 6 ปีที่แล้ว

    how to use groups authorization in this example please help

  • @parwizjoinda4287
    @parwizjoinda4287 5 ปีที่แล้ว

    Thanks for such a nice helpful video

    • @dndnegy73
      @dndnegy73 5 ปีที่แล้ว

      Mohammad Parwiz Khan
      Hi there
      Did the login page work with you? Redirecting you to index or not? Because with me it just loads and I’m not redirected to another page

  • @shahidwani6445
    @shahidwani6445 7 ปีที่แล้ว

    please make video on how to validate client app and to consume it thanks

  • @salman2184
    @salman2184 7 ปีที่แล้ว +1

    Can you please show a forgot password and password reset tutorial?

  • @pradeepsk2contact
    @pradeepsk2contact 5 ปีที่แล้ว

    awesome.. Nice tutorial :)

  • @tanmayikudalkar9936
    @tanmayikudalkar9936 2 ปีที่แล้ว

    Hi Sir,I watched your video,but when I am sending an email .I am getting this Error "The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Authentication Required" Please let me know your inputs on above error message

  • @koketsobaruti3623
    @koketsobaruti3623 3 ปีที่แล้ว

    THANK YOU SO MUCH!!

  • @DimitrisHD
    @DimitrisHD 6 ปีที่แล้ว

    Thanks for helping!

  • @dndnegy73
    @dndnegy73 5 ปีที่แล้ว +3

    I’m not redirected to any page when I login

    • @reijoao2
      @reijoao2 4 ปีที่แล้ว

      In UserController.cs, you have to write return before RedirectToAction("Index", "Home");

  • @restyrokamura8685
    @restyrokamura8685 7 ปีที่แล้ว

    i use visual studio 2010 and im having a problem on HttpCookie
    var cookie = new HttpCookie(FormsAuthentication.FormsCookieName, encrypted);
    it says HttpCookie could not be found

    • @subbusharma3990
      @subbusharma3990 3 ปีที่แล้ว

      you have to type in the package source for the cookies part such as
      Using System.Net.Security;

  • @muhammadadil-or3kb
    @muhammadadil-or3kb 6 ปีที่แล้ว +1

    Logout is not workin not redirect to the login page

    • @MKhizarBajwa
      @MKhizarBajwa 6 ปีที่แล้ว

      in action method use redirectToAction("someMethod");

  • @amritakumari4858
    @amritakumari4858 2 ปีที่แล้ว

    Thanks

  • @mauricioivanguerrerohernan3246
    @mauricioivanguerrerohernan3246 6 ปีที่แล้ว

    Gracias me ayudo de mucho :)

  • @ricardobakker5623
    @ricardobakker5623 6 ปีที่แล้ว

    Thank you kind sir!!!!!

  • @amamsharma372
    @amamsharma372 2 ปีที่แล้ว

    Thx ..

  • @adamrotik3788
    @adamrotik3788 7 ปีที่แล้ว

    Hi mate, have a problem with verifing account. once clicking on verification code what i get is error. furthermore once puting cursor over id in string id not getting the identification code. what can be the problem?

  • @gergobencsik1245
    @gergobencsik1245 6 ปีที่แล้ว

    "The current request for action 'login' on controller type 'UserController' is ambiguous between the following action methods:
    System.Web.Mvc.ActionResult Login() on type navicon.Controllers.UserController
    System.Web.Mvc.ActionResult Login(navicon.UserLogin, System.String) on type navicon.Controllers.UserController"
    I got this problm at the end .. PLS HELP ME !

    • @AdidosekPL
      @AdidosekPL 6 ปีที่แล้ว

      I guess that you forget [HttpPost] before ActionResult Login(naviicon.Userlogin, System.String)

  • @christiancervenka2865
    @christiancervenka2865 7 ปีที่แล้ว

    Thanks Sir ...

  • @lumweixin6591
    @lumweixin6591 7 ปีที่แล้ว

    Awesome videos Thanks Fyi Forget password feature??

    • @souravmondal45
      @souravmondal45  7 ปีที่แล้ว

      Ok, I will add. thanks for your suggestion

  • @tairqkhan5790
    @tairqkhan5790 7 ปีที่แล้ว

    Getting this Error ! The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. Learn more at

    • @souravmondal45
      @souravmondal45  7 ปีที่แล้ว

      +Tairq Khan have you updated your Gmail userid & password in the code?

    • @tairqkhan5790
      @tairqkhan5790 7 ปีที่แล้ว

      Yes i did it i google the problem but did not find any reliable sloution .So need your help beause in your video you did not get this error

    • @kanchanikrishna8599
      @kanchanikrishna8599 7 ปีที่แล้ว

      +Tairq Khan when you get security connection error you will receive one email with subject "Review blocked sign in attempt" at this time you need to enable "Allow less secure apps" for your email

  • @ZafarIqbal9922
    @ZafarIqbal9922 7 ปีที่แล้ว

    Dear I am getting exception during sending the sending email.
    one more thing. First record saved successfully but for second record I am getting exception what to do??

    • @souravmondal45
      @souravmondal45  7 ปีที่แล้ว

      what error are you getting?

    • @ZafarIqbal9922
      @ZafarIqbal9922 7 ปีที่แล้ว

      Record saved but get error when system try to send mail. Error is as under
      Unable to read data from the transport connection: net_io_connectionclosed.
      Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
      Exception Details: System.IO.IOException: Unable to read data from the transport connection: net_io_connectionclosed.
      Source Error:
      Line 132: IsBodyHtml = true
      Line 133: })
      Line 134: smtp.Send(message);
      Line 135:
      Line 136:

    • @ZafarIqbal9922
      @ZafarIqbal9922 7 ปีที่แล้ว

      Sir, May I ask you the solution about above mentioned error. I shall be very thanks full to you

  • @pritimay17
    @pritimay17 7 ปีที่แล้ว

    Dada ek2 help korbe??? login e click korle page refresh hoe jacce... onno kono error nei...

    • @souravmondal45
      @souravmondal45  7 ปีที่แล้ว

      I did not get you correctly??? It should refresh the page for post/submit provided credential for validation.

  • @MohitPaul84
    @MohitPaul84 7 ปีที่แล้ว

    Dear Sir I am getting exception during sending the sending email.
    (Exception in sendEmail:The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required)

    • @souravmondal45
      @souravmondal45  7 ปีที่แล้ว

      have you update the username & password with your gmail credential in your code?

    • @MohitPaul84
      @MohitPaul84 7 ปีที่แล้ว

      yes sir i did it

    • @juanefectivo
      @juanefectivo 7 ปีที่แล้ว

      i resolved here. sorry, my english is very poor.
      myaccount.google.com/lesssecureapps

  • @eripsync
    @eripsync 7 ปีที่แล้ว

    login page : when i input login email that got in database, and password i pu blank , i got this error.
    String reference not set to an instance of a String.
    Parameter name: s
    Line 10: public static string Hash(string value)
    Line 11: {
    Line 12: return Convert.ToBase64String(
    Line 13: System.Security.Cryptography.SHA256.Create()
    Line 14: .ComputeHash(System.Text.Encoding.UTF8.GetBytes(value))

    • @rupeshprasai3378
      @rupeshprasai3378 6 ปีที่แล้ว

      for this please validate the null in username and password

  • @piyushvv
    @piyushvv 7 ปีที่แล้ว

    var v = dc.Users.Where(a => a.C_EmailID == emailID).FirstOrDefault();
    return v != null;
    System.InvalidOperationException: 'The entity type User is not part of the model for the current context
    plz give me solution

    • @souravmondal45
      @souravmondal45  7 ปีที่แล้ว

      Here the user is an entity data model. Here in this article, I have used database first approach for generating entity model, So I have first created a database and a table named "User" and then generated the entity data model. Have you created the database and table or the entity data model?
      See Step 2, 3 & 4 from here www.dotnetawesome.com/2017/04/complete-login-registration-system-asp-mvc.html

    • @piyushvv
      @piyushvv 7 ปีที่แล้ว

      sourav mondal yes I m doing same way

    • @jconor012
      @jconor012 7 ปีที่แล้ว

      put everything inside the curly brace of using (entity)
      {var v = dc.Users.Where(a => a.C_EmailID == emailID).FirstOrDefault();
      return v != null;
      }
      Then you should be good

  • @kaviyaayyappan9109
    @kaviyaayyappan9109 4 ปีที่แล้ว

    how to fix system null exception in login.cs

    • @subbusharma3990
      @subbusharma3990 3 ปีที่แล้ว

      Can you provide the code or the error message so as to check for solutions?

  • @ZeeshanAli-nm4wg
    @ZeeshanAli-nm4wg 6 ปีที่แล้ว

    How to add session in this code? It is great but without sessions it ain't even shit

    • @souravmondal45
      @souravmondal45  6 ปีที่แล้ว

      Here in this tutorial we implemented token based authentication, so session is not require

  • @amittiwari-vc6wv
    @amittiwari-vc6wv 5 ปีที่แล้ว

    You are great sir, but after this part of video when i am running project by default it get the link: localhost:56236/=/user/login?ReturnUrl=%2f please help me out sir

  • @archinmodi4575
    @archinmodi4575 7 ปีที่แล้ว

    if user email is not active???
    how to redirect to active page???

    • @souravmondal45
      @souravmondal45  7 ปีที่แล้ว +1

      when user will click on the activation link from the email the user got after registration it automatically redirects the user to activation page. or you can give an option to the user to resend the email if he did not get the email or lost somehow.

    • @archinmodi4575
      @archinmodi4575 7 ปีที่แล้ว

      Thank you.

  • @sibonisozungu1748
    @sibonisozungu1748 7 ปีที่แล้ว

    Dear Sir Please Assist, The "Request.IsAuthenticated" return false please in that regard
    King Regards
    Siboniso

    • @souravmondal45
      @souravmondal45  7 ปีที่แล้ว

      is it after login?

    • @sibonisozungu1748
      @sibonisozungu1748 7 ปีที่แล้ว +1

      sourav mondal it does not login it just refresh the login page and clear the password field

  • @digital_shahrukh
    @digital_shahrukh 7 ปีที่แล้ว

    sir please you can give me some tipe of about asp.net mvc technical interview. how are
    interviewer take this.

    • @gaurav6177
      @gaurav6177 3 ปีที่แล้ว

      did u get the job?

    • @subbusharma3990
      @subbusharma3990 3 ปีที่แล้ว

      @@gaurav6177 I guess he got it xD

  • @flick--spadegaming9617
    @flick--spadegaming9617 2 ปีที่แล้ว

    12:59 login page code

  • @VivekSingh-xf1sn
    @VivekSingh-xf1sn 7 ปีที่แล้ว

    R u making videos for yourself. Not a single line explained? What line of what use?

  • @tayyabmehmood1866
    @tayyabmehmood1866 7 ปีที่แล้ว

    having prob with smtp :(

    • @souravmondal45
      @souravmondal45  7 ปีที่แล้ว

      what is the issue you are getting? Check your SMTP configuration.

    • @tayyabmehmood1866
      @tayyabmehmood1866 7 ปีที่แล้ว

      sourav mondal can I have ur email?

  • @harikrishnanr4808
    @harikrishnanr4808 4 ปีที่แล้ว +1

    If anybody is having trouble redirecting to Home/Index with [Authorize], kindly see this answer in stackoverflow. stackoverflow.com/a/63395607/9537501

  • @digital_shahrukh
    @digital_shahrukh 7 ปีที่แล้ว

    sir is ka first part ka link do plz..

    • @souravmondal45
      @souravmondal45  7 ปีที่แล้ว

      +Shahrukh Miya th-cam.com/video/gSJFjuWFTdA/w-d-xo.html

    • @digital_shahrukh
      @digital_shahrukh 7 ปีที่แล้ว

      thank you sir