ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2017 www.aspforums.com. All rights reserved.Pass multiple parameters from AngularJS to ASP.Net MVC controller<div class="edit-comment-hide"> <div class="comment-body markdown-body markdown-format js-comment-body"> <p>In my scenario I wanna pass two parameters (Array,string) to API controller POST method, How can I determine resource and setCode for passing two parameter?</p> </div> </div> <pre class="brush: js"> Resource: app.factory(&#34;EthnicCodeResource&#34;, [&#39;$resource&#39;, function ($resource) { return { Codes: $resource(&#39;api/Code/:collection&#39;, { collection: &#39;@collection&#39; }, { postCollection: { method: &#39;POST&#39;, isArray: true } }), Effects: $resource(&#39;api/Effects:reviewSetCode&#39;, { reviewSetCode: &#39;@reviewSetCode&#39; }, { setCode: { method: &#39;POST&#39;, isArray: true } }), HCodes: $resource(&#39;api/HCodes&#39;) } + + Save: EthnicCodeResource.Effects.setCode($rootScope.myData).$promise.then (function() { }); + API Controller: [HttpPost] public void Post(List reviewSetCode) { // + } + +In my scenario I wanna pass two parameters (Array,string)to API controller POST method, +like, [HttpPost] public void Post(List reviewSetCode, string act) { // + }. + </pre> <p>In my scenario I wanna pass two parameters (Array,string) to API controller POST method, How can I determine resource and setCode for passing two parameter?</p>http://www.aspforums.net/Threads/124654/Pass-multiple-parameters-from-AngularJS-to-ASPNet-MVC-controller/http://www.aspforums.net/Threads/124654/Pass-multiple-parameters-from-AngularJS-to-ASPNet-MVC-controller/Tue, 12 May 2015 03:53:08 GMTMerge Table Rows for same column value using AngularJS in ASP.Net<p>I want to display record on my html page like this.</p> <table> <tbody> <tr> <td width="399"> <p>Invoice No 1</p> </td> <td width="399"> <p>Product 1</p> </td> </tr> <tr> <td width="399"> <p>&nbsp;</p> </td> <td width="399"> <p>Product 2</p> </td> </tr> <tr> <td width="399"> <p>&nbsp;</p> </td> <td width="399"> <p>Product 3</p> </td> </tr> <tr> <td width="399"> <p>Invoice No 2</p> </td> <td width="399"> <p>Product 1</p> </td> </tr> <tr> <td width="399"> <p>Invoice No 3</p> </td> <td width="399"> <p>Product 1</p> </td> </tr> <tr> <td width="399"> <p>Invoice No 4</p> </td> <td width="399"> <p>Product 1</p> </td> </tr> <tr> <td width="399"> <p>&nbsp;</p> </td> <td width="399"> <p>Product 2</p> </td> </tr> <tr> <td width="399"> <p>&nbsp;</p> </td> <td width="399"> <p>Product 3</p> </td> </tr> </tbody> </table> <p>&nbsp;I have this information in a list here's my code</p> <p>&nbsp;</p> <pre class="brush: csharp">static void Main(string[] args) { List&lt;Program&gt; listdata = new List&lt;Program&gt;(); listdata.Add(new Program { InvoiceNo=001, Product=&#34;Product1&#34;}); listdata.Add(new Program { InvoiceNo = 001, Product = &#34;Product2&#34; }); listdata.Add(new Program { InvoiceNo = 001, Product = &#34;Product3&#34; }); listdata.Add(new Program { InvoiceNo = 001, Product = &#34;Product4&#34; }); listdata.Add(new Program { InvoiceNo = 001, Product = &#34;Product5&#34; }); listdata.Add(new Program { InvoiceNo = 002, Product = &#34;Product1&#34; }); listdata.Add(new Program { InvoiceNo = 003, Product = &#34;Product1&#34; }); listdata.Add(new Program { InvoiceNo = 004, Product = &#34;Product1&#34; }); listdata.Add(new Program { InvoiceNo = 004, Product = &#34;Product2&#34; }); listdata.Add(new Program { InvoiceNo = 004, Product = &#34;Product3&#34; }); foreach (var item in listdata) { Console.WriteLine(String.Format(&#34;Invoice No : {0} Product : {1}&#34;,item.InvoiceNo,item.Product)); } Console.ReadLine(); }</pre> <p>Had used foreach for example purpose,have to display data on a html page in ng-repeat in angular js am not able to arrange the required list in this format as displayed above.</p>http://www.aspforums.net/Threads/110395/Merge-Table-Rows-for-same-column-value-using-AngularJS-in-ASPNet/http://www.aspforums.net/Threads/110395/Merge-Table-Rows-for-same-column-value-using-AngularJS-in-ASPNet/Sun, 09 Apr 2017 02:08:19 GMTHow to Print a page or DIV using AngularJS<table style="height: 132px;" width="250"> <tbody> <tr> <td>Product</td> <td>Date</td> <td>Time</td> </tr> <tr> <td>juice</td> <td>2015-02-25</td> <td>14:00:00</td> </tr> <tr> <td>cheese</td> <td>2015-02-25</td> <td>07:00:00</td> </tr> <tr> <td>CHIPS</td> <td>2015-02-25</td> <td>16:00:00</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> </tbody> </table> <p>i have the above table that is displayed on a web page. i want to have a button that when its clicked it must call a function to print out just the table. how do i achieve this? do i have to send this data to a text file or something first? but i need to do it in angular js.</p> <p>i have a function that displays the above table as follows&nbsp;</p> <pre class="brush: js">function Report($http) { var self = this; self.$http = $http; self.GetReport = function () { var result = Ajax.Get(self.$http, { url: GetReportjson, success: function (data) { self.DisplayReport = data; } }).error(function () { alert(&#34; error!&#34;); }); } </pre> <p>&nbsp;</p>http://www.aspforums.net/Threads/177845/How-to-Print-a-page-or-DIV-using-AngularJS/http://www.aspforums.net/Threads/177845/How-to-Print-a-page-or-DIV-using-AngularJS/Wed, 25 Feb 2015 02:09:22 GMTHow to pass parameters from Angularjs to code behind<p>How to pass parameters from Angularjs to code behind.</p> <p>here is code</p> <p>&nbsp;$scope.submit = function (item) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $http.post('Default.aspx/getstring',{data: item})<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .success(function (data) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; alert(status.d);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; })<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .error(function (data) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $scope.status = status;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; });<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>i want to pass parameters 'item' to&nbsp;getstring() web method.</p> <p>can anyone help me and iam new to angularjs</p> <p>Thanks in advance</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p>http://www.aspforums.net/Threads/176472/How-to-pass-parameters-from-Angularjs-to-code-behind/http://www.aspforums.net/Threads/176472/How-to-pass-parameters-from-Angularjs-to-code-behind/Sun, 07 Feb 2016 23:51:11 GMTHow to implement Autocomplete TextBox using AngularJS in ASP.Net<p>Previously I was using jquery for autocomplete &nbsp;but it seems slow that angular js, I want to know how to use angular js .</p> <p>below my jquery code</p> <pre class="brush: js"> $(&#34;#HTL&#34;).autocomplete({ source: function (request, response) { var customer = new Array(); $.ajax({ url: &#34;/Home/expedia&#34;, data: &#34;{ &#39;Text&#39;: &#39;&#34; + request.term + &#34;&#39; }&#34;, dataType: &#34;json&#34;, type: &#34;POST&#34;, contentType: &#34;application/json; charset=utf-8&#34;, success: function (data) { console.log(&#39;auto&#39;); response($.map(data, function (item, id) { return { label: item.region, val: item.region } })) }, error: function (XMLHttpRequest, textStatus, errorThrown) { alert(textStatus); } }); }, focus: function (event, ui) { // prevent autocomplete from updating the textbox event.preventDefault(); // manually update the textbox $(this).val(ui.item.label); $(&#39;#HTLID&#39;).val(ui.item.val); }, minLength: 2, select: function (event, ui) { $(&#39;#HTL&#39;).val(ui.item.label); $(&#39;#HTLID&#39;).val(ui.item.val); return false; } }).data(&#34;autocomplete&#34;)._renderItem = function (ul, item) { return $(&#34;&lt;li id=&#34; + item.val + &#34;&gt;&lt;/li&gt;&#34;) .data(&#34;item.autocomplete&#34;, item) .append(&#34;&lt;a&gt;&lt;p&gt;&#34; + item.label + &#34;&lt;/p&gt;&lt;/a&gt;&#34;).appendTo(ul); };</pre> <p>&nbsp;</p>http://www.aspforums.net/Threads/429261/How-to-implement-Autocomplete-TextBox-using-AngularJS-in-ASPNet/http://www.aspforums.net/Threads/429261/How-to-implement-Autocomplete-TextBox-using-AngularJS-in-ASPNet/Mon, 24 Nov 2014 03:10:38 GMTGet url path without querystring using AngularJS in ASP.Net<p>Hi,</p> <p>When try get url&nbsp;path (home.html or page.html) with</p> <p><strong>var url = $location.path();</strong></p> <p>on my current path in browser add this&nbsp;<strong>#/home.html</strong></p> <p>and url look this:&nbsp;<a href="http://localhost:12241/home.html#/home.html">http://localhost:12241/home.html#/home.html</a></p> <p>i want only&nbsp;<a href="http://localhost:12241/home.html#/home.html">http://localhost:12241/home.html</a></p> <p>What is this, how solve this?</p>http://www.aspforums.net/Threads/206684/Get-url-path-without-querystring-using-AngularJS-in-ASPNet/http://www.aspforums.net/Threads/206684/Get-url-path-without-querystring-using-AngularJS-in-ASPNet/Wed, 15 Jun 2016 06:35:19 GMTAuthentication using AngularJS $routeProvider<p>how to do authentication using angularjs ,only using $routeProvider</p>http://www.aspforums.net/Threads/681466/Authentication-using-AngularJS-routeProvider/http://www.aspforums.net/Threads/681466/Authentication-using-AngularJS-routeProvider/Fri, 18 Sep 2015 03:46:46 GMTangularjs custom directives<p>custom directive examples</p>http://www.aspforums.net/Threads/760351/angularjs-custom-directives/http://www.aspforums.net/Threads/760351/angularjs-custom-directives/Tue, 18 Apr 2017 01:50:49 GMTAdd (Write), Read, Remove (Delete) Cookies in AngularJS Example<p>i already can get a cookie as the following. i call this cookie in my module and pass it as a parameter.how do i change the code to get a cookie in angular?</p> <p>&nbsp;</p> <pre class="brush: js">$(document).ready(function () { Cookie(); }); function getCookie(cname) { var name = cname + &#34;=&#34;; var ca = document.cookie.split(&#39;;&#39;); for (var i = 0; i &lt; ca.length; i++) { var c = ca[i].trim(); if (c.indexOf(name) == 0) return c.substring(name.length, c.length); } return &#34;&#34;; } function Cookie() { var cookie = getCookie(&#39;Id&#39;); } function Module($http) { var self = this; self.$http = $http; self.CookieID = getCookie(&#39;Id&#39;); self.test=function(){ var params = { testId:self.CookieID } } }</pre> <p>&nbsp;</p>http://www.aspforums.net/Threads/185913/Add-Write-Read-Remove-Delete-Cookies-in-AngularJS-Example/http://www.aspforums.net/Threads/185913/Add-Write-Read-Remove-Delete-Cookies-in-AngularJS-Example/Wed, 29 Apr 2015 03:23:32 GMT