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.Pass (Send) value from View to Controller using AngularJS in ASP.Net MVC<p>Hi&nbsp;mahesh213,</p> <p>Check this example. Now please take its reference and correct your 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(); } [HttpGet] public JsonResult getRights(string FLI_Code) { List&lt;Right&gt; right; if (FLI_Code == &#34;138&#34;) { right = new List&lt;Right&gt;(); right.Add(new Right { Id = 1, UAR_Add = 1, UAR_Edit = 0 }); right.Add(new Right { Id = 2, UAR_Add = 0, UAR_Edit = 1 }); } else { right = new List&lt;Right&gt;(); right.Add(new Right { Id = 1, UAR_Add = 0, UAR_Edit = 1 }); right.Add(new Right { Id = 2, UAR_Add = 1, UAR_Edit = 0 }); } return Json(right, JsonRequestBehavior.AllowGet); } public class Right { public int Id { get; set; } public int UAR_Add { get; set; } public int UAR_Edit { get; set; } } }</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;script type=&#34;text/javascript&#34; src=&#34;https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.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, $http) { $scope.GetAllRights = function () { var Id1 = 138 $http({ method: &#39;get&#39;, url: &#39;/Home/getRights/&#39;, params: { FLI_Code: JSON.stringify(Id1) } }).then(function (data) { $scope.rights = data.data; }, function (response) { alert(&#34;Records gathering failed!&#34;); }); } }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div ng-app=&#34;MyApp&#34; ng-controller=&#34;MyController&#34;&gt; &lt;input type=&#34;button&#34; value=&#34;Save&#34; ng-click=&#34;GetAllRights()&#34; /&gt;&lt;br /&gt;&lt;br /&gt; &lt;div ng-repeat=&#34;right in rights&#34;&gt; &lt;button ng-if=&#34;right.UAR_Add==1&#34;&gt;Add&lt;/button&gt; &lt;button ng-if=&#34;right.UAR_Edit==1&#34;&gt;Edit&lt;/button&gt; &lt;hr /&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><strong><span style="text-decoration: underline;"><img src="https://i.imgur.com/JBTkOpU.gif" alt="" width="236" height="140" /></span></strong></p>https://www.aspforums.net:443/Threads/117013/Pass-Send-value-from-View-to-Controller-using-AngularJS-in-ASPNet-MVC/https://www.aspforums.net:443/Threads/117013/Pass-Send-value-from-View-to-Controller-using-AngularJS-in-ASPNet-MVC/Mon, 29 Jul 2019 05:17:34 GMT