Questions tagged [asp.net-ajax]
ASP.NET AJAX, previously called "Atlas," is an extension of ASP.NET developed by Microsoft for creating more interactive and responsive web pages. It's a set of technologies that enable you to make asynchronous requests from the client (browser) to the server, hence updating parts of a web page without reloading the entire page.
asp.net-ajax
5,292
questions
859
votes
22
answers
1.0m
views
How can I deserialize JSON to a simple Dictionary<string,string> in ASP.NET?
I have a simple key/value list in JSON being sent back to ASP.NET via POST. Example:
{ "key1": "value1", "key2": "value2"}
I AM NOT TRYING TO DESERIALIZE INTO STRONGLY-TYPED .NET OBJECTS
I simply ...
488
votes
18
answers
232k
views
jQuery $(document).ready and UpdatePanels?
I'm using jQuery to wire up some mouseover effects on elements that are inside an UpdatePanel. The events are bound in $(document).ready . For example:
$(function() {
$('div._Foo').bind("...
439
votes
11
answers
673k
views
ASP.NET MVC controller actions that return JSON or partial html
I am trying to create controller actions which will return either JSON or partial html depending upon a parameter. What is the best way to get the result returned to an MVC page asynchronously?
222
votes
15
answers
194k
views
Setting Access-Control-Allow-Origin in ASP.Net MVC - simplest possible method
I have a simple actionmethod, that returns some json. It runs on ajax.example.com. I need to access this from another site someothersite.com.
If I try to call it, I get the expected...:
Origin http:/...
163
votes
9
answers
157k
views
How can I convince IE to simply display application/json rather than offer to download it?
While debugging jQuery apps that use AJAX, I often have the need to see the json that is being returned by the service to the browser. So I'll drop the URL for the JSON data into the address bar.
...
81
votes
9
answers
77k
views
Rebinding events in jQuery after Ajax update (updatepanel)
I have several input and option elements on my page, each (well almost) have an event attached to update some text on the page once they change. I use jQuery which is really really cool :)
I also ...
74
votes
5
answers
82k
views
How do I force full post-back from a button within an UpdatePanel?
How do I force full post-back from a button within an UpdatePanel?
72
votes
5
answers
70k
views
How to have a javascript callback executed after an update panel postback?
I'm using a jQuery tip plugin to show help tips when the user hovers certain elements of the page.
I need to register the plugin events after the page is loaded using css selectors.
The problem is I'...
65
votes
31
answers
140k
views
Sys is undefined
I have an ASP.Net/AJAX control kit project that i am working on. 80% of the time there is no problem. The page runs as it should. If you refresh the page it will sometimes show a javascript error "...
62
votes
2
answers
41k
views
Are MicrosoftAjax.js, MicrosoftMvcAjax.js and MicrosoftMvcValidation.js obsolete as of ASP.NET MVC 3?
Are MicrosoftAjax.js, MicrosoftMvcAjax.js and MicrosoftMvcValidation.js obsolete as of ASP.NET MVC 3? I haven't been able to find much info on this on the web, but from what I've read it implies that ...
62
votes
3
answers
90k
views
ASP.NET MVC modal dialog/popup best practice
I am looking for the most standard way to achieve modal dialogs in ASP.NET MVC.
An example of what I am trying to do is when I select an item from my "list" page, I want the "details" page to be a ...
56
votes
16
answers
126k
views
Disable ASP.NET Forms button after click to prevent double clicking
I have an ASP.NET button that I need to disable after the user clicks it to prevent double-clicking. Once the submit completes it has to be enabled again. Can anyone help me with this?
49
votes
7
answers
36k
views
One Update Panel vs. Multiple Update Panels [closed]
I have an ASP.NET web page that displays a variety of fields that need to be updated best on certain conditions, button clicks and so on. We've implemented AJAX, using the ASP.NET Update Panel to ...
47
votes
8
answers
72k
views
Serialize Entity Framework objects into JSON
It seems that serializing Entity Framework objects into JSON is not possible using either WCF's native DataContractJsonSerializer or ASP.NET's native JavaScript serializer. This is due to the ...
46
votes
8
answers
103k
views
How to post ASP.NET MVC Ajax form using JavaScript rather than submit button
I have a simple form created using Ajax.BeginForm:
<% using (Ajax.BeginForm("Update", "Description", new { id = Model.Id },
new AjaxOptions
{
UpdateTargetId = "DescriptionDiv",
...
46
votes
6
answers
95k
views
A potentially dangerous Request.QueryString value was detected from the client when sending html markup from jquery post call to asp.net page
I m making an ajax call using jQuery to an ASP.NET page which acts as my ajax server page to save the data which i am sending to it in the query string. In the ASP.NET page when i am trying to read ...
44
votes
8
answers
113k
views
ModalPopupExtender OK Button click event not firing?
I have a Button inside an UpdatePanel. The button is being used as the OK button for a ModalPopupExtender. For some reason, the button click event is not firing. Any ideas? Am I missing something?
...
43
votes
2
answers
26k
views
Method 'get_EnableCdn' in type 'System.Web.UI.ScriptManager' from assembly 'System.Web.Extensions' does not have an implementation
Can anyone explain a parse error like this one:
"Method 'get_EnableCdn' in type 'System.Web.UI.ScriptManager' from assembly 'System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=...
43
votes
7
answers
163k
views
How to send a model in jQuery $.ajax() post request to MVC controller method
In doing an auto-refresh using the following code, I assumed that when I do a post, the model will automatically sent to the controller:
$.ajax({
url: '<%=Url.Action("ModelPage")%>',
...
39
votes
8
answers
32k
views
How to specify javascript to run when ModalPopupExtender is shown
The ASP.NET AJAX ModalPopupExtender has OnCancelScript and OnOkScript properties, but it doesn't seem to have an OnShowScript property. I'd like to specify a javascript function to run each time the ...
38
votes
8
answers
85k
views
Full postback triggered by LinkButton inside GridView inside UpdatePanel
I have a GridView inside of a UpdatePanel. In a template field is a button I use for marking items. Functionally, this works fine, but the button always triggers a full page postback instead of a ...
37
votes
1
answer
2k
views
Javascript error when using Messenger Connect client-side library in ASP.NET
I'm having a problem implementing the new Messenger Connect functionality inside an existing Sitefinity site to enable client logins using Live IDs.
Namely, when I'm using the following code to ...
36
votes
6
answers
19k
views
ASP.NET MVC and Ajax, concurrent requests?
AJAX newbie here!
At the moment in my ASP.NET MVC web app my AJAX requests appear to be getting batched or queued, im not sure.
No requests seem to be getting completed until the previous request has ...
34
votes
5
answers
14k
views
Thread Safety in Javascript?
I have a function called save(), this function gathers up all the inputs on the page, and performs an AJAX call to the server to save the state of the user's work.
save() is currently called when a ...
33
votes
3
answers
45k
views
What's the difference between $get and $find in JavaScript?
I'm a .NET programmer who've just started to learn more about client side scripting, and I was wondering sometimes you use $get('value') and $find('value') and I've discovered that these are just ...
33
votes
4
answers
43k
views
Sys.Application.add_load() vs. $(document).ready() vs. pageLoad()
I have page that has some javascript that needs to run at page load. Said javascript needs to locate the client-side component of a ServerControl, which it does with $find().
Of course, if I emit my ...
29
votes
6
answers
65k
views
Pass data from a ASP.NET page to ASCX user controls loaded dynamically
I'm developing an ASP.NET application with C# and Ajax.
I have a page that holds user controls loaded dynamically. I need to pass some data (integer values and some strings) to the user control that ...
28
votes
4
answers
44k
views
Ajax Request returns HTTP error 500, using MVC and $.ajax call with POST?
I've seen several threads about this, and I've tried all the answers (ASP.NET MVC JsonResult return 500)
My ajax request is re-turning a 500 Internal Error. If I debug I never even get to my action.
...
28
votes
5
answers
18k
views
LinkButton in ListView in UpdatePanel causes full postback
I have a LinkButton in a ListView in an UpdatePanel. I would like the button (well, any of them) to cause a partial postback, but they are causing a full page postback.
<asp:UpdatePanel ID="...
26
votes
4
answers
39k
views
Ajax Pagination in PagedList.MVC using partial Page
PagedList.Mvc is working fine if I do not use partial page but when I use partial page with ajax to load the grid then there is problem in pagination.and I ended with the support from TroyGoode https:/...
26
votes
4
answers
64k
views
How do I make a Textbox Postback on KeyUp?
I have a Textbox that changes the content of a dropdown in the OnTextChanged event. This event seems to fire when the textbox loses focus. How do I make this happen on the keypress or keyup event?
...
26
votes
5
answers
35k
views
how to submit query to .aspx page in python
I need to scrape query results from an .aspx web page.
http://legistar.council.nyc.gov/Legislation.aspx
The url is static, so how do I submit a query to this page and get the results? Assume we ...
25
votes
6
answers
39k
views
ASP.NET - UpdatePanel and JavaScript
Is there a way to execute script when an UpdatePanel process is finished.
I have a page that allows "inserting", "copying", and "editing" of a record.
This is all done on an UpdatePanel to prevent a ...
25
votes
12
answers
47k
views
Base class includes the field 'X', but its type (System.Web.UI.ScriptManager) is not compatible with the type of control (System.Web.UI.ScriptManager)
The full error is
The base class includes the field 'ScriptManager1', but its type (System.Web.UI.ScriptManager) is not compatible with the type of control (System.Web.UI.ScriptManager).
Anyone ...
25
votes
5
answers
47k
views
How can I send int array from ajax to c# mvc?
How can I send int array from $.ajax to c# mvc?
24
votes
5
answers
33k
views
How do I know that a form input has changed?
I have a form generated by <% Ajax.BeginForm() {} %> which contains a lot of inputs and texareas.
When an input value change, I need to know about it and mark the input and the form as "dirty". ...
24
votes
5
answers
189k
views
window.open with target "_blank" in Chrome
I have a small javascript function which opens an url in a new tab:
function RedirectToPage(status) {
var url = 'ObjectEditor.aspx?Status=' + status;
window.open(url , '_blank');
}
This always ...
23
votes
4
answers
44k
views
How to change returned ContentType in ASP.NET MVC controller (ActionResult)
I have ASP.NET MVC controller named dictionary with method ControlsLangJsFile.
Method returns view of users control (ASCX) which contain JavaScript variables.
When i call the method it returns ...
21
votes
14
answers
11k
views
ASP.NET webforms + ASP.NET Ajax versus ASP.NET MVC and Ajax framework freedom
If given the choice, which path would you take?
ASP.NET Webforms + ASP.NET AJAX
or
ASP.NET MVC + JavaScript Framework of your Choice
Are there any limitations that ASP.NET Webforms / ASP.NET ...
21
votes
6
answers
145k
views
How to pass multiple parameters from ajax to mvc controller?
Controller
[HttpPost]
public ActionResult Save(string StrContactDetails, bool IsPrimary)
{
}
$.ajax({
async: true,
type: "POST",
url: @url.Action("Helper","Save"),
data: {
...
21
votes
4
answers
30k
views
Does Session timeout reset on every request
Does Session timeout reset on every request regardless of whether we check sessions variables? Or we should use atleast one session variables?
Does Ajax request cause resetting session timeout? like ...
21
votes
5
answers
44k
views
How to use Ajax.BeginForm MVC helper with JSON result?
I'm trying to use the ASP.NET MVC Ajax.BeginForm helper but don't want to use the existing content insertion options when the call completes. Instead, I want to use a custom JavaScript function as the ...
21
votes
1
answer
44k
views
Difference between script manager and toolkit script manager
What are the differences between ScriptManager and ToolkitScriptManager? I found only one convincing reason: that ToolkitScriptManager improves page performance. If so why use ScriptManager?
21
votes
2
answers
25k
views
asp.net mvc 3 - ajax form submit and validation
I am sorry if this has been asked already, but I have been looking for sometime but all I have found are rather old posts (mvc1, mvc2).
I have a form which I would like to submit via Ajax.
This looks ...
20
votes
5
answers
54k
views
Deserializing JSON objects as List<type> not working with asmx service
I am having trouble deserializing my JSON string. I have a class of type person with public properties for sequence number of type int, first name, and last name. I want to pass an array of these ...
20
votes
2
answers
15k
views
Html.RenderPartial and Ajax.BeginForm -> Submit is called twice
I have the following index view:
@model BoringStore.ViewModels.ProductIndexViewModel
@{
ViewBag.Title = "Index";
}
<h2>Produkte</h2>
<div id='addProduct'>
@{ Html....
20
votes
4
answers
54k
views
How to call function on timer ASP.NET MVC
I need to call function on timer (lets say onTickTack() function) and reload some info in ASP.NET MVC project. I know that there are several ways to do that, but which one is the best by your opinion? ...
20
votes
2
answers
36k
views
Message: Invalid JSON primitive: ajax jquery method with Webmethod
I am using Data value as object literal, instead of concatenating a String as explained in this answer
My code is the following:
$.ajax({
url: "../Member/Home.aspx/SaveClient",
type: "POST",
...
19
votes
5
answers
18k
views
ASP.NET MVC "Ajax.BeginForm" executes OnSuccess even though model is not valid
I have a "submit feedback" form which uses "Ajax.BeginForm" to render a partial containing the form elements. The OnSuccess event is triggering even if the ModelState is not valid. Is this normal? I ...
19
votes
7
answers
13k
views
Internet Explorer Caching asp.netmvc ajax results
I'm having an issue with a page in internet explorer.
I have an ajax call that calls a form, in other browser, when I click the link it passes in the controller and load correctly data. but in IE, ...