Click here to Skip to main content
15,920,801 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a Login page in asp.net. In loginbutton_click calling a method which is inside wcf service , that service method returning 1 or 0 . I am assigning that in to variable that is result.If result is 1 that is redirect to registration.aspx else it will show error message "Invalid Login".like above my login page is working.that thing need in angulrjs. My requirement is login page in angularjs with that wcf method call.

Find below my button click event code
------------------------------------------------
JavaScript
btnlogin_click()
{
    int result=0;
    if(txtuserid.text !=string.Empty && txtpassword.text !=string.Empty)
    {
        IServiceProvider s= new IServiceProvider();
        result = s.getlogindetails(txtuserid.text.trim(),txtpassword.text.trim());
        if(result==1)
        {
            session["userid"]=txtuserid.text.trim();
            response.redirect("registration.aspx");
        }
        else {
            lblmessagr.text="invalid ligin"
        }
    }
}


What I have tried:

Please help on this m new to the angularjs
Posted
Updated 24-Apr-16 20:18pm
v2
Comments
FranzBe 25-Apr-16 3:13am    
So in response to your "requirement" you expect to get the AngularJS equivalent of your code snippet?! well, you need to write an AngularJS controller that handles the service call part and you need an AngularJS view that does the UI part. In case you search for "AngularJS login example" you will find some tutorials that point you the way to go, e.g. this one
http://jasonwatmore.com/post/2015/03/10/AngularJS-User-Registration-and-Login-Example.aspx

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900