Send (Pass) input type date value from View to Controller using AngularJS in ASP.Net MVC

Last Reply 6 months ago By dharmendr

Posted 6 months ago


I have 2 textboxes

currently issue is that after clicking go button relevant values are coming to debugging but that values are not coming to controller

    Layout = null;
    <link rel="stylesheet" href="">
    <script src=""></script>
    <script src=""></script>
    <script src="//"></script>
    <script src="~/scripts/attendanceentry.js"></script>
    <script src="~/masters/dirpagination.js"></script>   
    <script type="text/javascript">
        var app = angular.module('MyApp', [])
        app.controller('MyController', function ($scope, $window) {
            $scope.Go1 = function () {
                var fd = $scope.FDate;
                var td = $scope.TDate;
                $.post("/home/Edit1/", { Fdate: fd, tdate: td }, function (r) {

<body ng-app="MyAp" ng-controller="MyControllerr">
    <div class="container">       
        <div id="wrapper" class="clearfix" >
            <div class="well">
                <div class="form-horizontal">
                    <div class="row">
                        <div class="col-md-4">
                           <label for="FDate">From Date</label>
                           <input type="date" ng-model="FDate" id="FDate" name="FDate" class="form-control" required />
                        <div class="col-md-4">
                            <label for="lblTDate">To Date</label>
                            <input type="date" ng-model="TDate" id="TDate" name="TDate" class="form-control" required />
                    <hr />
                    <div class="form-group">
                        <p><button class="btn btn-success btn-sm"ng-click="Go1()">Go</button></p>


public JsonResult Edit1( DateTime? Fdate, DateTime? tdate)
This question does not have replies that have been liked.