[Solved] Call Controller action from JavaScript [closed]

Just use an AJAX call: <div id=’some-container’>Loading…</div> <script type=”text/javascript”> $(document).ready(function() { $.get(‘@Url.Action(“Add”, “BankController”)’, function(viewResult) { $(“#some-container”).html(viewResult); alert(viewResult); }); }); </script> 5 solved Call Controller action from JavaScript [closed]

[Solved] Cannot group strings correctly if use IEnumerable.GroupBy in C# [closed]

To really make sure it comes out as you want it, you could do it like that: var val = val1 .GroupBy(f => Path.GetFileNameWithoutExtension(f)) //group by filename .OrderBy(group => group.Key); //here’s the “Sort” foreach (var group in val) { var q = group.OrderByDescending(f => Path.GetExtension(f)); //order the filenames for outputting foreach (var f in q) … Read more

[Solved] Create table using two dimensional array

Have you tried looking at ListViewItem and then populating a list view? If not then you can easily use a list of arrays, or even populate it in a foreach loop like bellow? foreach( var v in Muvees ) {ListViewItem movieToAdd = new ListViewItem(); movieToAdd.Text = v.movieid; movieToAdd.SubItems.Add(v.rating); movieToAdd.SubItems.Add(v.movieName); listOfMovies.Items.Add( movieToAdd ).BackColor = Color.Green;} //add … Read more

[Solved] How to login external web site from asp.net web page? [closed]

Hopefully, most web sites will prevent this type of thing. It is considered a cross site request forgery. You can read more about it here and if you still want to do it, at least you will know what you are getting into. Be safe. http://en.wikipedia.org/wiki/Cross-site_request_forgery 1 solved How to login external web site from … Read more

[Solved] Javascript dealy 1 second [closed]

Add a timeout. First create a variable to hold the timer at the top, like this: var timeout = null; Then update the display_menu parent to operate on a timeout (my comments in the code explain): function display_menu(parent, named) { // First clear any existing timeout, if there is one if (timeout) clearTimeout(timeout); // Set … Read more

[Solved] Finding location using google API in mvc 5

I have worked with freegeoip and to get the geo location from this is as below. URL:- http://freegeoip.net/xml/{ip} In this you can provide your IP and can see result in browser. Implementation in code. string apiUrl = http://freegeoip.net/xml/{ip} HttpClient HttpClient = new HttpClient(); var response = HttpClient.GetAsync(apiUrl).Result; if (response != null && response.ReasonPhrase != “Unauthorized”) … Read more