Search Posts

Category: asp.net-mvc

ui-router, can’t navigate to another route

how to ui-router, can’t navigate to another route I am having issues with angularJs ui-routing in Mvc app. I have seen several questions regarding this issue. This question in particular seems to be addressing my issue. However I am unable to navigate to different routes. In my Views/Home/Index.cshtml: <base href=”/” /> <h1> index</h1> <a href=”/login”>login</a> In my Angular/app.js: var App = angular.module(‘myApp’, [‘ui.router’]); App.controller(“loginController”, LoginController); App.config(function ($stateProvider, $urlRouterProvider, $locationProvider) { $stateProvider .state(‘login’, { url: ‘/login’, […]

How can I call another method after a method has executed without providing a callback?

how to How can I call another method after a method has executed without providing a callback? Within my application I have some inputs which call methods once their input text has changed. I create them using custom helpers, Ex: @Helpers.GenerateProductFilter(string id, string value) Which result in tags similar to this: <input type=”text” id=”@id” value=”@value” ng-model=”SoftwareProductInput” ng-change=”SoftwareProductChange()” /> As you can see, there is a method, SoftwareProductChange(), that gets called on change. My goal is […]

AngularJs Mvc5 ui-routing problems

how to AngularJs Mvc5 ui-routing problems I am writing an MVC5 app with angularJs ui-routing. I have seen several questions regarding this issue. This question in particular seems to be addressing my issue. However I simply cant get it to work i.e I am unable to navigate to different routes. In my Views/Home/Index.cshtml: <base href=”/” /> <h1> index</h1> <a href=”/login”>login</a> In my Angular/app.js: var App = angular.module(‘myApp’, [‘ui.router’]); App.controller(“loginController”, LoginController); App.config(function ($stateProvider, $urlRouterProvider, $locationProvider) { […]

angularjs pagination doesn’t work in asp.net mvc5

I have to make single-page site with CRUD features based on Asp.net MVC and angularjs with pagination (4 items on 1 page). CRUD operations has been created but now I have problem with pagination. Pagination doesn’t work and I don’t know why. Below you can see my partial view for landing page: <body ng-app=”APIModule”> <h2>Items</h2> <div id=”tblSubs” ng-controller=”APIController”> <div class=”form-group”> <label>Add here</label> <input type=”text” class=”form-control” placeholder=”Enter type of item” [required=”string” ] data-ng-model=”type” /> <input type=”text” […]

Validating a negative number on MVC Framework

I have a problem with the validation that which the data cannot be negative in a specific transaction which is from purchased minus the remaining and the result is to the remaining quantity. The data must not be transact or having a negative number on the data column. CONTROLLER public JsonResult LoadPageData(Page page) { int beginning = page.itemPerPage * (page.PageNumber – 1); List<Stocks> stocks = new List<Stocks>(); using (var context = new InventoryDbContext()) { var […]

Angular Routing and Binding data from controller

I have my angular routing like th below code var app = angular.module(‘mainApp’, [‘ngRoute’]); app.config(function ($routeProvider) { $routeProvider.when(‘/’, { templateUrl: ‘/DeclarationForms/V1/EmployeeProfile.html’, controller: ’empController’ }).when(‘/DeclarationAndIndemnityBond.html’, { templateUrl: ‘/DeclarationForms/V1/DeclarationAndIndemnityBond.html’, controller: ‘declarationController’ }).otherwise({ redirectTo: “/” }); app.controller(’empController’, function ($scope, $http) { var resultPromise = $http.get(“../ViewForms/GetData/”, { params: { ProcName: “SP_EmployeeProfile_GetList” } }); resultPromise.success(function (data) { console.log(data); $scope.employeeProfile = data; }); }); }); The empController calls my controller action with a parameter as per the code $http.get(“../ViewForms/GetData/”, { params: […]

I need to run a function without any interaction from the user to update an angular modal(should happen automatically without user interactions)

i need to update the angular model when textbox has the jquery value automatically..please help enter image description here In here I am using change function but it also need the keyboard click.. Value will come to textbox without keyboard input or copy paste and after value came angular modal should update automatically. html page html page as in image this my directive directive(‘checkTest’, function () { return { restrict: “A”, link: function (scope, elem, […]

Posting NULL Data to asp.net core controller using angularjs

i am posting data from angularjs to .net core controller, but i am getting null values StudentController [HttpPost] public JsonResult AddStudent(Student stu) { if (stu != null) { db.Students.Add(stu); db.SaveChanges(); return Json(stu); } else { return Json(“Some Error Occured”); } } Module.js var myApp = angular.module(‘myApp’, []); Service.js myApp.service(“myService”, function ($http) { //get All Eployee // Add Employee this.AddEmp = function (Employee) { var response = $http({ method: ‘post’, url: ‘Employee/AddStudent/’, data: JSON.stringify(Employee), dataType: ‘json’ […]

Next Page »