Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Ajax ActionLink causes new page to be created instead of staying on the page as Partial result

$
0
0

Here is the simple data 

 @Ajax.ActionLink("update", "page1data", "Home", new AjaxOptions { HttpMethod = "Get", OnSuccess = "function (result) { $('#mydiv').html(result)" });

And then 

<div id="mydiv">Here is where the text goes</div>

When the ajax runs, it creates a new web page thats not part of my project at localhost:/whatever/Home/page1data 

The goal, the actual need is to fetch data to fill a Grid and it needs to be formatted in JSON.   So in the Home controller there is the method that correctly returns the JSON from the database, works great.  Just not able to get this into the Grid, because am not able to get the JSON result into a jquery or javascript friendly variable.

Can the HTML helper for ajax be used here?  or does the ajax have to be constructed manually?    I have done this before a while back and dont recall the syntax to get the results from the Ajax into the local variable, unable to find any examples;  the http GET method lives at /Home/page1data  and takes no arguments, it returns JSON

Thanks for any help


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>