1

I have this .cshtml page to login

<main id="login" ng-controller="loginCtrl">
<div id="page" class="full-screen min-height">
    <div id="page-inner">
        <div id="login-page-content" class="min-height-inner container-padding">
            <div class="container center text-center">
                <h1>
                    <label>Login</label>
                </h1>
                <div id="login-form">
                    <div>
                        <input type="email" id="Username" placeholder="UserName/Email" class="login-input" required="required" />

                    </div>
                    <div>
                        <input type="password" id="Username" placeholder="Password" class="login-input" required="required" />
                    </div>
                    <div>

                    </div>
                    <div class="cf">
                        <input type="submit" value="Login" class="login-submit" ng-click="clicked()"/>
                    </div>
                </div>
                <a href="#!/forgotPassword"> Forgot Details ? </a>
            </div>
        </div>
    </div>
</div>

and this is my controller.js

angular.module('userManagement')
.controller('loginCtrl', ['$scope', '$http','$window', function ($scope, $http,$window) {
    $scope.clicked = function () {
        window.location = '#/join';
    }
}
]);

and also my app.js

 $routeProvider.caseInsensitiveMatch = true;

$routeProvider.when('/login', { templateUrl: 'Account/login', controller: 'loginCtrl' }); I want to be able to go to another page when i click the button, vallidations are not important for now I just want the buttons to go to the page when i click a button, with the above code it takes me to

http://localhost:52653/Account#!/login#%2Fjoin

fulufhelo mudau
  • 79
  • 2
  • 14
  • Please check the below link Once. It may help you out [https://stackoverflow.com/questions/33720267/how-to-navigate-one-page-to-another-page-using-angularjs](https://stackoverflow.com/questions/33720267/how-to-navigate-one-page-to-another-page-using-angularjs) – Santhosh kumar Vadlamani Jul 03 '17 at 17:34

1 Answers1

2

You should use the angular route system or ui.router :

ngRoute and location

$location.path( "#/join" );

ui.router

$state.go(path_to_join_state);
Dan M. CISSOKHO
  • 1,070
  • 1
  • 12
  • 27