Is there a way to make a controller return something to the user first then execute another method? I have a process that is very time consuming. I'd like to send back a quick JSON response to the user then process.
I need to run the HttpContext.Current.Server.Execute method in my ASP.NET application. This application has a WCF operation that does some processing. Currently, I am to do my processing correctly from within my WCF operation. However, I would like to do this asynchronously.
In an error to attempt this asynchronously, I tried running Server.Execute in the DoWork event handler of a BackgroundWorker. Unfortunately, this throws an error that says
"object reference not set to an instance of an object" The HttpContext element is not null. I checked that. It is some property nested in the HttpContext object that appears to be null. However, I have not been able to identify why this won't work. It happens as soon as I move the processing to the BackgroundWorker thread. My question is, how can I asynchronously execute the Server.Execute method?
I need to load and execute SSIS or DTS packages ASYNCHRONOUSLY from ASP.NET C# page on click of a button and report the success or failure at the end of the execution and if it fails the details of the exception should be shown to the user. it needs to be asynchronous because job could take a long time to finish. user should also be able to cancel the execution of the package while it is running if he wishes to do so. there is also requirement to execute multiple packages in parallel and track the progress for each of them. is this possible to achieve OR too complicated to do it from ASP.NET?
I need to run the HttpContext.Current.Server.Execute method in my ASP.NET application. This application has a WCF operation that does some processing. Currently, I am running a Server.Execute call from within my WCF operation and getting the results I would expect. However, I would like to do this asynchronously.This is where my problem comes in. In an error to run Server.Execute asynchronously, I tried running Server.Execute in the DoWork event handler of a BackgroundWorker. Unfortunately, this throws an error that says
"object reference not set to an instance of an object"
The HttpContext element is not null. I checked that. It is some property nested in the HttpContext object that appears to be null. However, I have not been able to identify why this won't work. It happens as soon as I move the processing to the BackgroundWorker thread. My question is, how can I asynchronously execute the Server.Execute method? Are there options beyond BackgroundWorker that will work?
I have an ASP.NET (3.5) web page which calls a few web methods (SOAP based) using jQuery's .ajax method. The web methods implement 'ScriptMethod' attribute and return JSON data. The web service file (asmx) is local to the same project.
I noticed these web methods execute synchronously on the server which means they run sequentially and affect performance negatively, some methods are waiting, when some of them are slow.
I read this article and I am not sure if I understand that WebMethods which implement Scriptmethod can run synchronously only (they implement IHttpHandler not IHttpAsyncHandler).
If this is true, I might have to change the design. I am looking for other designs, maybe like using WCF, where the browser can call webmethods using JavaScript and the web methods run asynchronously on the server.
I'm trying to understand how to execute AJAX animation on an asp button that has to execute code on Postback. In other words, I have button with code behind that needs to be excuted, but at the same time want to be able to have one of animation extenders be applied to it. I understand that I need to use the BeginRequest Event, I'm just not sure how, or which javascript commands to use to call the ajax animation so the postback will still occur.
I am looking through a sql stored procedure which I might need to update in the near future. Basically the stored procedure is about 20 lines long. The stored procedure first builds a query
and stores it in a variable named "@Sql". And then for the last two lines of the stored procedure it appears that the big sql statement stored in "@Sql" is executed by using the "EXEC" command. See below. What is confusing though is that the query appears to be exectuted twice? Why was the query written in this way. Don't both lines do the same thing? Why is it being done twice? Could this possibly be a mistake on the part of the person who wrote the query. Below are the two lines I am talking about?
I need to asychronously call a web service from an ASP.NET application. The aspx does not need the answer from the web service. It's just a simple notification.
I'm using the ...Async() method from web service stub and <%@Page Async="True" %>.
ws.HelloWorldAsync();
My problem: the web page request is waiting for the web service response.
How to solve this problem? How to avoid any resource leak when the web service is down or when there is an overload?
I've been looking for a way to achieve this behavior and I found this sample project.
The trick in this project is that it changes the form target to an iframe created on the fly.
So far so good, I can get the byte[] on the server-side. But I need to change an image preview after the file is uploaded.
How can I get the iframe to update the main page? Would I have to save it on a file on the disk, make a javascript callback to change the image url? Is there another way to do this? What's recommended?
I have a portfolio website I am building for fun, I am graduating about this time next year. I have added ASP.NET themes to this portfolio website, and I have added themes to other ASP.NET sites before. I really love the feature! I have been noticing though that other sites (not asp.net that I've seen) change "Themes" without the page refreshing and I understand its probably just changing which CSS the site is using. Is there a way to do something like this in ASP.NET 4.0?
I am just setting the default theme in the web.config, and then setting a session variable through a couple asp:ImageButton's, then in the Page_PagePrePreInit setting the page.theme to the session variable. This is my first time taking that route, I usually use "profiles" to save the theme info.
What are the alternatives to System.Diagnostics API for running external EXE or BAT files under IIS hosted web application?
I would like to run external EXE program from my ASP.NET-MVC web application. I don't need to wait till the program exits. I just want to start the program. The execution can take some time or it may crash, so I would like to run it separatelly from IIS in such a way that the web application only triggers its execution.
On the home page of my site I want to display a lot of products which have images which are quite large. Currently the page is taking so long to load that it is actually timing out and the page fails to display!
In MVC, or just ASP.NET in general, how can I load an image asynchronously? Basically what I want to do is display the details of the product and just display a small loading image e.g. ajaxload.info. until the image is loaded.
I assume this is going to require some javascript/jQuery...
I have MVC application (applies to non MVC as well) where a user is posting in data. I need to take this data, send it off to two seperate end points (one using a WebRequest form POST and one using a Web Service), parse the result, and send the result back to the original user.
The issue at hand is that both end points take about 20-30 seconds to respond (response is a string) which means that I should probably execute these two calls asynchronously. At the same time I want to wait to respond to the original user until I get both results back. I am guessing I might have to use some sort of object lock so the response does not get sent back before the two calls are complete?
Based on the responses I decided to go with async controllers since I am already working with a MVC application.
suppose i have one button and i want that when user click this button and then a method will be called asynchronously.how to do it in asp.net 2.0. please help me with sample code.
Is it possible to send multiple HTTP requests asynchronously to an ASP.NET web site or any other web server using .NET ? And, then. collect responses from those requests as they come using .NET asynchronous paradigm ? Is it possible ? Or would there still be limit of max 2 HTTP connections from .NET using HTTP ?
Here is the situation. I need to hit ~50 servers and grab some data from a file. I then want to display a few rows for each in an ASP.NET GridView control.
I tried doing this with Threads/ThreadPool and successfully gather all the data in session.
What I'd like to do, and what I am having a hard time figuring out, is update the grid for the user after each server is done loading.
If I put the databinding code in the thread, it will only display whatever has loaded by the time the response is sent back to the client. If I take it out of the thread, I'd have to wait until all threads were done to send the response, and that doesn't do what I want.
I seeing some stuff about Asynchronous Client Callbacks, but I'm not sure if that's what I need to be using. I have no idea how to manipulate a GridView from Javascript.
I make an asynchronous call from one web service to another web service deployed on different server? The scenario is that an ASP.NET webforms page will call a web service in an async manner. This particular web service will then make another async call to a second web service deployed on different web server. This this possible to achieve, and what additional steps or code would be necessary to make this happen?
I want to ask that what happens when I make a database request (using Linq-To-Sql). Active thread is blocked and waits for response, or it is used to process other requests?
Do frameworks like Linq-To-Sql or Linq-To-Entities handle this?
If I use Sleep() method on thread, is that thread blocked or is it used to process other requests?
I am working on an ajax application in which user can see chart (an image) of any available product. For generating chart I am using MS-Chart control. User will click a product link, its id will be passed to server side where image will be generated, returned to client side and displayed. All this is to be done asynchronously.
I thought to call a call web method, but what web method will return ?
I tried using HttpHandler but I did not get how to pass parameter (id) to it ?
I want to update panels (panel1 and panel2) asynchronously. However when the page loads, if i try to edit a row and update it, panel1's RequiredFieldValidator gives an error message * and row's update link does not work!. After adding a company from panel1, update link starts to work. How can i solve the problem?
Basically I have a site where I want the user to input something, have it go to the server for processing and then return it asynchronously, load the contents into a div and then fade it in with jQuery. What is the best way to the do accomplish this?
It doesn't work - just returns the contents of Default.aspx. So how do I properly send the contents of #txtInput to the ParseData function in Default.aspx.vb? Also, is this the best way to accomplish something like this? Should I even need to use jQuery to send the data, or should I simply call the function and have it grab the data server-side, put in the information in the result div, and then show it using jQuery?