AJAX :: Async Call To Save Data?
Mar 15, 2010
Since data saving is a time consuming, I would like to call data saving method using Ajax and that too Async what i mean is as soon as the user click submit button it just display the confirmation page and data saving bit keeps going on in the background.
Is this possible using Ajax tool kit?
View 3 Replies
Similar Messages:
Feb 23, 2011
I want to make an async call to the server when an achor tag is clicked and then have the browser advance to the href without waiting for the async call to return a result. I am using System.Web.UI.ICallbackEventHandler. My server code is not executing. The server code only executes if the GetCallbackEventReference call specifies a clientscript value which means the page has to wait before advancing. What am i doing wrong?
My client code is:
<script type="text/javascript">
function ReceiveServerData(arg, context) {
}
function DoAsyncTask(arg)
{
CallServer(arg, '');
return false;
}
</script>
View 3 Replies
Jan 11, 2010
In our application we have a scenario where we need to display a panel using modalpopupextender after performing an async call on the server. We were using the Show method for displaying the popup. It used to work fine without any async call. But when an async call was introduced during the request processing the popup is not getting displayed.
View 7 Replies
Mar 14, 2010
How do force full page rendering in async call process?
[Code]....
View 4 Replies
May 13, 2010
I have a simple web page in ASP.NET / C#. Currently to fully render the data I require calling a block of code that runs on background threads and can take multiple minutes to complete. I've got it to the point (using the async attribute on the page declaration) to execute and return fine with the html once it's done. What I'd like it to do is allow me to return immediately with a 'loading page' of some sort and then have that page be updated when the background work has been completed. Right now I get nothing on the page while the background work is being processed.
View 3 Replies
Nov 11, 2010
For example, I am using wenclient.DownloadfileAsync to download a file asynchronously.
In the DownloadFileCompleted event handler, I can check if I have any exception or not by using AsyncCompletedEventArgs.Error property.
If I re-throw this exception, however my executable is stopping running immediately.
I am wondering how to handle this kind of exeception? How to pass this exception back to the
calling thread?
View 1 Replies
Jun 14, 2010
My javascript code is calling a asp.net webservice, so i have a call to the webservice something like this:MyWebservice.GetData(param, ResponseReceived, ResponseTimeOut, ResponseError);When the webservice returns data, ResponseReceived method is called.However sometimes the user might navigate to another url before the webservice call actually returns, in such a scenario FireFox throws an Error saying 'An error occured oricessubg the request. The server method GetData failed'So my question is how can i kill the async call when the user navigates to another page or makes another request to the webservice? I know in a normal XMLHttpRequest i could have called Abort method, but not sure how to make it work with the above webservice proxy.
View 2 Replies
Sep 3, 2010
I'm trying to save some content whenever a button/hyperlink is clicked using jquery.ajax (Using Asp.net 3.5). The logic is as follows:
Through .bind in jquery I bind my own method(MakeLog) to a button click or hyperlink click. The click events of button/hyperlink contain nothing, I need to use .bind for selective controls.Now we have a button whose click event will fire a method, say MakeLog.Code snippet for MakeLog is as follows:
var xhr = jQuery.ajax({
url: "/Logger.aspx",
data: { content: logContent }, [code]....
This works fine in IE but in Firefox this is not sending the data back as expected.I tried to identify the issue and came across the following: http://stackoverflow.com/questions/3522944/jquery-ajax-calls-async-false-vs-async-true .What I understand is that, whenver page is redirecting/reloading due to button click or hyperlink click the async call is not working properly.
View 1 Replies
Apr 20, 2010
I am trying to build a site that will display a word ("Synset" in my code) from a "function call", (ultimately the word will come from another database but I'm ignoring that part for now). The user will click one of 4 radio buttons deciding if the word is "positive", "negative", "neutral", or "can not be determined". Then the user clicks "Save" the word is saved a MS SQL database, the function is called displaying a new word and the process is repeated.
So far I have been able to get this to mostly work by using the code below. The problem is that the function is called and the correct word displayed when the page loads the first time, when I click a radio button and then the "Submit" button, the word and value from the radio button are saved to the database but then no new word is displayed. The text just disappears. The new word is created, as I can see that new words are saved to the database when i click submit.
I'm thinking the issue might be because I'm binding the text attribute of the label I'm using to display the word to the sqldatasource, because it's probably trying to display the text from the database?
I've tried putting the code that gets and displays the new word in FormView1_PageIndexChanging() and submitButton_Click() and neither work.
I've tried to just call Response.Redirect("Default.aspx") in submitButton_Click() and this displays the word but nothing is saved to the database.
[Code]....
View 4 Replies
Mar 23, 2011
I'm trying to get something like this to work
[Code]....
What I'm looking for is to disable the submit button if any of the inner updatepanels are in postback mode. I would also like some way to block that particular panel. I guess for the outer updatepanel, updatemode should be set to conditional, and usechildrenastriggers should be false. What's really bugging me is how to block the panel while a postback is occurring.
In all my tests thus far, the outer updatepanel's updateprogress is triggered, which blocks the whole page.
View 2 Replies
Feb 16, 2010
So I have a page with an UpdatePanel and some controls in there. When I explicitly type/copy+paste the page's address into the address bar, let VS navigate there for me, or follow a link to the page, all of the AJAX works fine. But if I refresh this page, the JS on the page initiates the async postback, but the appropriate event is never called on the server (although Page_Load is) and the client never recieves the markup sent back by the server. This issue seems to be limited to Firefox 3.6 (Gecko build 1/15/2010)(doesn't happen in IE8). I have yet to try on other versions of Firefox.
View 2 Replies
Jul 26, 2010
I have a very typical set up, an ajax update panel is updated when a drop list of offices changes. Each form could have it's own values, for instance each store will have it's own list of employees. Here is where the fun begins. The form can be changed by the drop down (new office) or validated and submitted.
On drop down change, I create a new instance of the same rad combo, bind it to the current data, confirm that the correct data is bound. Then on the return trip I see selected the default user from the previous user. This is a composite control, and firebug shows me that the value for the "text box" that simulates the combo still has the old value. I'm suspecting onViewStateLoaded, but turning viewstate off for the Telerik didn't . II don;t need it anyway, cuz I have to put the selected value in another hidden to make a cross page post on submit.
View 2 Replies
Mar 29, 2010
I'm working on adding a todo list to a project system and would like to have the todo creation trigger a async postback to update the database. I'd really like to host this in a usercontrol so I can drop the todo list onto a project page, task page or stand alone todo list page.
Here's what I have.User Control "TodoList.ascx" which lives in the Controls directory.
The script that sits at the top of the UserControl. You can see where I started building jsonText to postback but when that didn't work I just tried posting back an empty data variable and removed the 'string[] items' variable from the AddTodo2 method.
<script type="text/javascript">
$(document).ready(function() {
// Add the page method call as an onclick handler for the div.
[code]...
I can have a control that can be used to display multiple todo lists and create a brand new todo list as well.When I click on the #divAddButton I can watch it build the postback in firebug but once it completes it runs the error portion by alerting 'error'. I can't see why.
I'd really rather have the response method live inside the user control as well. Since I'll be dropping it on several pages to keep from having to go put a method on each individual page.
View 2 Replies
Dec 9, 2010
I'm running into an issue with an async call to the server that only works one time, then it appears to become a synchronous call. Let me try to explain.
It's an MVC 2.0 site, using ASP.NET and Ajax. I'm using the Ajax.BeginForm helper, like so:
<% using (Ajax.BeginForm("Start", null,
new { virtualMachineId = xyz },
new AjaxOptions { UpdateTargetId = "VirtualMachineForm", OnBegin="OnStartingVm" }
)){
[Code]....
Within the updateStartingStatus function, the first part runs every second, every time. However, within the Ajax call, the success result works every second on the first time only. Then on the second time I click on the start button all of the requests queue up. After the starting has completed, about 20 seconds later, I get a bunch of alert windows back to back. So, I can tell that updateStartingStatus runs every second every time, but the ajax call appears to switch to become a sync call after the first time.
I have to fully close it and open it again. The same occurs in IE and Chrome.
One more thing to note is that the updated div (VirtualMachineForm) contains most of the page, including the button being pressed. So it basically replaces the page from under itself. Not sure if that would cause any issues.
Additionally, if I debug in Visual Studio 2010, the call isn't made to the controller action when the issue occurs. So, it appears to be something client-side. I've ruled out any issues server-side.
View 2 Replies
Sep 15, 2010
I have a series of div's inside an update panel, these divs have a margin-bottom defined in css. In IE8, when I do a async postback these margins are all removed. All the other styles are fine. If I turn on compatibility mode this does not happen. In Google Chrome the margins are maintained correctly after the async postbacks.
View 1 Replies
Apr 27, 2010
I am creating a ASP.Net server control to manage locations. The control is a composite control containing several text-boxes, labels, and a link button. I use the AJAX Control Toolkit to provide a modal popup which contains a Bing map. All the Javascript is in its own file and used as an embedded web resource.
The link button is what opens the modal popup. It also needs to call a Javascript function that initializes the Bing map (onclick = "GetMap();"). There are instances when this server control is placed within an Update Panel (and there is no way to avoid this). When in an Update Panel the link button loses its onclick event. I understand that this is because during an async postback the portion of the DOM that defines the content of the Update Panel is thrown out and reinitialized, resulting in the event breaking. When the control is not in an Update Panel everything works as intended.
I have tried registering events on Page.Load and Page.Init, like so:
[Code]....
I have also tried flat out writing the function call to the page:
[Code]....
I have put breakpoints on the lines inside each delegate and they do not get hit. I am not aware of any special way to register events of a composite control's child control or the Page.Load/Page.Init events when being done inside a server control. Is there some special way to register these events? (Note: Both those code blocks above are in my CreateChildControls() method)
Below is the GetMap() Javascript function. As you can see it is pretty straight forward.
[Code]....
View 3 Replies
May 28, 2010
Here is the code. On button click it should perform async refreshing. Instead it does a full page postback.
[Code]....
View 5 Replies
May 11, 2010
i'm using asp.net 2.0 form with ajax. i have an ihhtpmodule which can thrown an exception at Application_EndRequest step. my problem is that if this happen in an async postback (i mean a postback of an update panel) i can't manage the exception (with manage i mean set a custom error message server-side) becouse it's too late for the error handler of the ScriptManager.
(the alert will print a message as:
Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
Details: Error parsing near 'MyButt" />
|<html>
<head>)
at the moment my idea is to clear the response in the module and find a way to use the scriptmanager to send the correctly response of an error/exception. it's this possible? or samebody has another option of how to manage this case? note:i can't edit the aspx to manage this client client side with custom javascript
View 3 Replies
Jun 23, 2010
I'm trying to combine nested listviews, updatepanel and asyncfileupload, but have run into some problems. I'm having a main listview listing some projects, and in each project I have a nested listview listing some images in that project. I also have an insertitemtemplate, for inserting new images. This template contains an asyncfileupload control. Everthing is contained in one large UpdatePanel, to enable smooth editing of the images and their associated information.
Problem 1:
The fileupload is complete now, and the file uploads as I expect. In the AsyncUploadCompleted event I'm also inserting the uploaded image to the database. So far so good. But when the upload is done, I want to be able to see the newly updated record in my nested listview. But this is not the case. I'm not able to DataBind the listview in the AsyncUploadCompleted, because that throws an exception saying "The control collection cannot be modified....". So, how do I manage to do an async update of the nested listview, showing the new record?
Problem 2:
When deleting items from my nested listview, after the async update the listview shows up without any items except the InsertItem. The items are not removed, a refresh of the page brings them back. Why is the databinding lost during the async postback?
View 2 Replies
Feb 26, 2011
i am using vs 2010
i want to use AsyncFileUpload Control in my web application
i choosen nor web application template in vs 2010
and i added reference to the ajax tool kit dll
and when i choose any file from async file upload control i got the exception unhandled exception..
View 1 Replies
Sep 20, 2010
I have following code and when I select from my drop down list the progress controls do not show and my grdiview is not being filled either. If I leave out the update panel from my code things are working fine.
[Code]....
[Code]....
[Code]....
View 4 Replies
Nov 10, 2010
Am I missing a trick here ???
I am using VWD 2008.. I have a RadioButtonList with two options.
[Code]....
I also have an UpdatePanel
[Code]....
When the LoadingOption change it then has some code behind that at the moment changes the <asp:Literal ID="ItemName" runat="server" /> text.
If I don't have a Radiobutton selected when the page loads then all works fine. i.e. I can select either radiobutton and the ItemName updates correctly.... Whats the problem you may ask ????
Well I want to have one of the Radio buttons selected when the page has been loaded (like a default setting). So I do this <asp:ListItem Text="1kVA" Value="1kVA" Selected="True" />........ Here is my problem, When I select the other option (7kVA) the ItemName updates fine BUT if I then select the first option (1kVA) the ItemName does not update. I added another button that just does a postback. When the button is clicked the ItemName updates correctly. OK, fine but I don't want that. I want to be able to click on one option and the ItemName updates then click on the other option and the ItemName updates.
Have I missed something out ??
By the way if I set the <asp:AsyncPostBackTrigger ControlID="LoadingOptions" /> to <asp:PostBackTrigger ControlID="LoadingOptions" /> then it works how I want it apart from the reloading of the page, I would like it to update in Async Mode so it is seemless and no page reload.
View 9 Replies
May 22, 2010
I want to provide status updates during a long-running task on an ASP.NET WebForms page with AJAX.Is there a way to get the ScriptManager to execute and process a script for a web service request concurrently with an async postback? I have a script on the page that makes a web service request. It runs on page load and periodically using setInterval(). It's running correctly before the async postback is initiated, but it stops running during the async postback, and doesn't run again until after the async postback completes.
View 3 Replies
Dec 13, 2010
I have to code a chart which get his data of a PLC-control. The problem is that the PLC send every second a measurement to my program, so I have to refresh the chart every second. Via a timer-element of AJAX I can load the chart every second with new data, but I donīt know how I can make this asynchronous.
I want to have this:
The chart-Website should refresh the chart every second via the ajax-timer. The measurements which were used should stand in an array which is updated with the PLC-control-Function.
BUT I DONīT KNOW HOW I CAN DO THIS!!!
View 1 Replies
Mar 2, 2011
I tried to search around, but could not find anything for this question which must be wrong, because I would guess there were a lot of topics about it.
Anyway, I would like to load lists on my site in a similar style to Facebook and Twitter, where initially x records are loaded into the list, and then after the page has loaded the list expands downwards with more rows of content, or add a "more" button in the end. I am using ASP.NET with C#.
View 1 Replies