ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.Send (Pass) input type date value from View to Controller using AngularJS in ASP.Net MVC<p>Hi <a class="username" rel="mahesh213"> mahesh213</a>,</p> <p>Change the below lines.</p> <blockquote><cite>mahesh213 says:</cite> <div class="line number17 index16 alt2"><code class="html spaces"></code><code class="html plain">var fd = $scope.FDate;</code></div> <div class="line number18 index17 alt1"><code class="html spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="html plain">var td = $scope.TDate;</code></div> </blockquote> <p>Check the below code.</p> <p><strong><span style="text-decoration: underline;">Controller</span></strong></p> <pre class="brush: csharp">public class HomeController : Controller { // GET: /Home/ public ActionResult Index() { return View(); } [HttpPost] public JsonResult Edit1(DateTime? Fdate, DateTime? tdate) { return Json(&#34;&#34;); } }</pre> <p><strong><span style="text-decoration: underline;">View</span></strong></p> <pre class="brush: html">&lt;html xmlns=&#34;http://www.w3.org/1999/xhtml&#34;&gt; &lt;head&gt; &lt;title&gt;Index&lt;/title&gt; &lt;link rel=&#34;stylesheet&#34; href=&#34;https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css&#34;&gt; &lt;script type=&#34;text/javascript&#34; src=&#34;https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js&#34;&gt;&lt;/script&gt; &lt;script type=&#34;text/javascript&#34; src=&#34;https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js&#34;&gt;&lt;/script&gt; &lt;script type=&#34;text/javascript&#34; src=&#34;https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.5/angular.js&#34;&gt;&lt;/script&gt; &lt;script type=&#34;text/javascript&#34;&gt; var app = angular.module(&#39;MyApp&#39;, []); app.controller(&#39;MyController&#39;, function ($scope, $window) { $scope.Go1 = function () { var fd = $scope.FDate.toISOString().split(&#39;T&#39;)[0]; var td = $scope.TDate.toISOString().split(&#39;T&#39;)[0]; $.post(&#34;/Home/Edit1/&#34;, { Fdate: fd, tdate: td }, function (r) { }); } }); &lt;/script&gt; &lt;/head&gt; &lt;body ng-app=&#34;MyApp&#34; ng-controller=&#34;MyController&#34;&gt; &lt;div class=&#34;container&#34;&gt; &lt;div id=&#34;wrapper&#34; class=&#34;clearfix&#34;&gt; &lt;div class=&#34;well&#34;&gt; &lt;div class=&#34;form-horizontal&#34;&gt; &lt;div class=&#34;row&#34;&gt; &lt;div class=&#34;col-md-4&#34;&gt; &lt;label for=&#34;FDate&#34;&gt; From Date&lt;/label&gt; &lt;input type=&#34;date&#34; ng-model=&#34;FDate&#34; id=&#34;FDate&#34; name=&#34;FDate&#34; class=&#34;form-control&#34; required /&gt; &lt;/div&gt; &lt;div class=&#34;col-md-4&#34;&gt; &lt;label for=&#34;lblTDate&#34;&gt; To Date&lt;/label&gt; &lt;input type=&#34;date&#34; ng-model=&#34;TDate&#34; id=&#34;TDate&#34; name=&#34;TDate&#34; class=&#34;form-control&#34; required /&gt; &lt;/div&gt; &lt;/div&gt; &lt;hr /&gt; &lt;div class=&#34;form-group&#34;&gt; &lt;p&gt; &lt;button class=&#34;btn btn-success btn-sm&#34; ng-click=&#34;Go1()&#34;&gt; Go&lt;/button&gt; &lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt;</pre> <p><strong><span style="text-decoration: underline;">Screenshot</span></strong></p> <p><img src="https://i.imgur.com/YbYY0vO.jpg" alt="" width="472" height="68" /></p>https://www.aspforums.net:443/Threads/169648/Send-Pass-input-type-date-value-from-View-to-Controller-using-AngularJS-in-ASPNet-MVC/https://www.aspforums.net:443/Threads/169648/Send-Pass-input-type-date-value-from-View-to-Controller-using-AngularJS-in-ASPNet-MVC/Tue, 13 Aug 2019 08:19:37 GMT