Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Server Error in '/' Application.
- The resource cannot be found.
- Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily Requested URL: /Webogin/Welcome
- Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.2110.0 unavailable. Please review the following URL and make sure that it is spelled correctly.
- /// <reference path="../angular.min.js" />
- var app = angular.module("WebClientModule", [])
- .controller('Web_Client_Controller', ["$scope", 'myService', function ($scope, myService) {
- $scope.OperType = 1;
- //1 Mean New Entry
- //To Clear all input controls.
- function ClearModels() {
- $scope.OperType = 1;
- $scope.Username = "";
- $scope.Password = "";
- }
- $scope.createuser = function () {
- var User = {
- Username: $scope.Username,
- Password: $scope.Password
- };
- if ($scope.OperType === 1) {
- var promisePost = myService.post(User);
- promisePost.then(function (pl) {
- $scope.User_Id = pl.data.User_Id;
- window.location.href = "~/Webogin/Welcome";
- ClearModels();
- }, function (err) {
- $scope.msg = "Password Incorrect !";
- console.log("Some error Occured" + err);
- });
- }
- }
- }]);
- app.service("myService", function ($http) {
- //Create new record
- this.post = function (User) {
- var request = $http({
- method: "post",
- url: "http://localhost:52098/HalifaxIISService.svc/AddNewUser",
- data: User
- });
- return request;
- }
- })
- @{
- Layout = null;
- }
- <html data-ng-app="WebClientModule">
- <head title="ASAS">
- <title></title>
- <script src="~/Scripts/angular.min.js"></script>
- <script src="~/UserLoginScript/CreateUserScript.js"></script>
- </head>
- <body>
- <table id="tblContainer" data-ng-controller="Web_Client_Controller">
- <tr>
- <td>
- <table style="border: solid 2px Green; padding: 5px;">
- <tr style="height: 30px; background-color: skyblue; color: maroon;">
- <th></th>
- <th>ID</th>
- <th>Username</th>
- <th>Password</th>
- <th></th>
- <th></th>
- </tr>
- <tbody data-ng-repeat="user in Users">
- <tr>
- <td></td>
- <td><span>{{user.User_Id}}</span></td>
- <td><span>{{user.Username}}</span></td>
- <td><span>{{user.Password}}</span></td>
- <td>
- <input type="button" id="Edit" value="Edit" data-ng-click="get(user)" />
- </td>
- <td>
- <input type="button" id="Delete" value="Delete" data-ng-click="delete(user)" />
- </td>
- </tr>
- </tbody>
- </table>
- </td>
- </tr>
- <tr>
- <td>
- <div style="color: red;">{{Message}}</div>
- <table style="border: solid 4px Red; padding: 2px;">
- <tr>
- <td></td>
- <td>
- <span>User ID</span>
- </td>
- <td>
- <input type="text" id="User_Id" readonly="readonly" data-ng-model="User_Id" />
- </td>
- </tr>
- <tr>
- <td></td>
- <td>
- <span>Username</span>
- </td>
- <td>
- <input type="text" id="username" data-ng-model="Username" required=""/>
- </td>
- </tr>
- <tr>
- <td></td>
- <td>
- <span>Password</span>
- </td>
- <td>
- <input type="password" id="password" required data-ng-model="Password" require=""/>
- </td>
- </tr>
- <tr>
- <td></td>
- <td></td>
- <td>
- <input type="button" id="Createuser" value="Submit" data-ng-click="createuser()" />
- <input type="button" id="Clear" value="Clear" data-ng-click="Clear()" />
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </body>
- </html>
- <script src="~/UserLoginScript/CreateUserScript.js"></script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement