Web Forms :: How To Display Staus Of Long Process
Mar 18, 2010
Want to display staus of long process. when user click on button calling some function which will return the percentage of work done .I want to display that persentage in some where in the page.How can i do it?
private void ImgButtonadd_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
int persentdone=0;
for (int iRow = 0; iRow < Rows; iRow++)
{
persentdone=getworkprocess(file(iRow));
}
}
i want to display this persentdone in my page somewhere.
View 1 Replies
Similar Messages:
Jul 21, 2010
I know that similar questions have been asked all over the place, but I'm having trouble finding one that relates directly to what I'm after.
I have a website where a user uploads a data file, then that file is transformed and imported into SQL. The file could be up to 50mb in size, and some times this process can take 30 minutes or sometimes even longer.
I realise I need to palm off the actual work to another process, and poll that process on the web page. I'm wondering what the best approach would be though? Being a web developer by trade, I'm finding all this new Windows Service stuff a bit confusing, and I just wanted somewhere to start.
So:
Can I do / should I being doing this with a windows service? if so, how?
Should I use WCF? If this runs under IIS, will I have problems with aspnet_wp.exe recycling and timing out my process?
clarifications
The data is imported into sql, there's no file distribution taking place.
If there is a failure, it absolutely MUST be reported to the user. The web page will poll every, lets say, 5 seconds, from the time the async task begins, to get the 'status' of the import. Once it's finished another response will tell the page to stop polling for status updates.
queries on final decision
ok, so as I thought, it seems that a windows service is the best idea. So as to HOW to get it to work, it seems the 'put the file there and wait for the service to pick it up' idea is the generally accepted way, is there a way I can start a process run by the service, without it having to constantly be checking a database table / folder? As I said earlier, I don't have any experience with Windows Services - I wondered if I put a public method in the service, can I call it somehow?
View 2 Replies
Jan 20, 2011
On my current project I have to accept 2 Excel spreadsheets that will be uploaded by clients, process them and create a download package based on this information. This process includes extracting data from the sheets, updating our databases and building several PDF files for the download package. This takes between 15 seconds to 2 minutes to complete, depending on the complexity of the request. Naturally, I want to show some kind of processing indicator rather than just leaving the user hanging while the page loads.
Here's the problem: How to show this processing indicator.
I have to do a full postback to upload the files so this eliminates several nice AJAX indicator methods (sponsoring users rejected the AJAX toolkit async file upload, saying it was confusing to them). If I process on any of the page events during the postback, the page doesn't load until the lengthy process is completed so the browser/site looks 'hung'.
Basically, I need some ideas on how to display a 'building your download' graphic while the lengthy process is working that will also work with a full postback.
View 4 Replies
Feb 12, 2010
What are your most successful ways of running a long process, like 2 hours, in asp.net and return information to the client on the progress.
I've heard creating a windows service, httphandler and remoting can be successful.
View 4 Replies
Mar 7, 2010
I have an asp.net page that calls a dll that will start a long process that updates product information. As the process is running, I want to provide the user with constant updates on which product that process is on and the status of the products. I've been having trouble getting this to work. I add information to a log text file and I was thinking that I'd redirect to a new page and have that page use Javascript to read from the text file every few seconds. My question is has anyone else tried this and does it work fairly well?
View 3 Replies
Mar 18, 2010
In an asp.net web form, I keep getting a connection reset error message. The page is doing a some long running processing (about 2-5 minutes).
I have no problem when the web request comes from the same machine as the web server. But when the request originates across the network, I get a connection reset error about 1:30 or 2 minutes into waiting for a response.
I have set the in web.config for this application and put the application it's own application pool.
What else can I try?
Edit
The purpose of this page is to accept input from the user, calculate something, and send the result back to them. The long running calculation isn't something I can offload until a later time.
View 2 Replies
Jun 11, 2010
When my Application face a long-time process, i.e fetch a query (SELECT a, b, c FROM d)This query needs 10 seconds to be completed in the MSSQL Management Studio, but when the ASP.NET application try to fetch it, it refuse to return any response to any other requests made on that Server.
I am hosting my Application on VPS Server with good specifications, and I am giving this example the (SELECT a, b, c FROM d) just to tell you the issue, it can be any process, maybe processing a movie, or even fetching some data through external API that is experiencing some slow-down,or whatever.
View 2 Replies
Jan 28, 2010
Note:- i don't want to use updateprogress etc. control of ajax
on button click, long task(e.g thread) runs in my webpage for about 4-5 minutes.I want to show status to user either by a processing image through javascript(image must be shown in a certain part of page other part of page will remain intact) or an exact status of process if possible. i have tried a lot but all in vein.
View 5 Replies
May 14, 2010
Situation:I have an ASP .NET application that will search through docs using Lucene. I want to run the initial indexing (the index will be incremental after the initial run so there wont be need to index the whole directory again in future). Currently, I have about 5GB of docs (45000files).Problem: My application times out before completing the process. I have altered the TimeOut like this:HttpContext.Current.Server.ScriptTimeout = 200000;but it still does not complete the process.
View 1 Replies
Jan 30, 2010
I've asked this before but I was hoping for another answer and perhaps some code samples because I've been having a difficult time with this. I have an asp.net page. The user hits the "Run" button and I have code IN AN ASSEMBLY, not in the APP_CODE folder that is called and runs a long process that moves product info from a file into the database. While the user waits, I would like them to see status updates like what product the import process in on and status info. I'm assuming I'd break off into another thread and use Ajax but I have no idea how to do this.
View 2 Replies
Jan 30, 2010
I've been having a difficult time with this. I have an asp.net page. The user hits the "Run" button and I have code IN AN ASSEMBLY, not in the APP_CODE folder that is called and runs a long process that moves product info from a file into the database. While the user waits, I would like them to see status updates like what product the import process in on and status info. I'm assuming I'd break off into another thread and use Ajax but I have no idea how to do this.
View 4 Replies
Aug 13, 2010
Wondering if there is a performance difference between letting a long running process hang in asp.net vs running the process via a windows service. I have done this once before and the windows service was much quicker and didnt bog down my system, whereas the asp.net request seemed to wreak havoc.
View 1 Replies
Aug 25, 2010
I have Requirement to update the label text as we are processing the code (Long running).
Example:
I have Label and button on aspx page.
On button Click Iam calling the AppCode which is going to do long work for me.
I want to update the label text from the appcode (which should reflect in the page then and there.)
I have tryed to pass the text value to the label but it shows the changed text only after the event for the button click is finished.
I tryed using timer but as soon as i click the button the refreshing stops.
I tryed progress template and UpdateProgress without success. (I know we can update at the start and end of proccess using this)
I dont want to use iframe (I know we can do using iframe)
View 3 Replies
Nov 30, 2013
How to show progressbar when processing a text file of million lines?
I checked your thread --> [URL]
But what I want is the progressbar should show percentage exactly.
View 1 Replies
Jun 16, 2010
I've developed a web application to accept video file uploads and then pass them to a backend service on an external server. The application runs without error on the visual studio debugging webserver, but once on a production iis 6 or 7 server, yields a timeout error at about a consistent amount of time into handling a large upload. Specifically, it errors in the middle of transferring the video file to the external server, once the application has successfully received it from the client. I'm aware of several timeouts to be configured related to the problem, and have done so. The application's web config has been tested with one or both of the following settings
<system.web>
<httpRuntime executionTimeout="9999999" maxRequestLength="2048000" />
</system.web>
and
<configuration>
<location path="default.aspx"> (the page at issue that's timing out)
<system.web>
<httpRuntime executionTimeout="9999999" maxRequestLength="2048000" />
</system.web>
</location>
</configuration>
And within the initialization of the webrequest made to the external server to send the video received from the client browser:
HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(url);
httpWebRequest.ContentType = "multipart/form-data; boundary=" + boundary;
httpWebRequest.Method = "POST";
httpWebRequest.Timeout = System.Threading.Timeout.Infinite;
So with the execution time limits on both the webform as a whole and the connection made to the external server, I'm at a loss for what timeout is left unconfigured, or how to determine such, when I continue to get the following error: Unexpected error executing Brightcove Upload:...........................
View 3 Replies
Apr 7, 2014
In my website, there is a page called "SMS Log"It contains a GridView, in which there are 5 columns:
1) SMS sent time
2) SMS Text
3) Recipients
4) status
5) Button (view detail) since, "SMS Text" is large and "Recipients" are more than 1.
So Gridview looks very conjusted, also it does not look good.Is there any other control I can use other than Gridview to show above 5 columns in a well organized way.
View 1 Replies
Jul 6, 2010
I posted this on the vb.net forum and was told I should post it here.
What I'm trying to do should be simple but it hasn't been for me. I have a page that produces several Crystal reports. It has a button for each type. I use the button's onclick feature to process that particular report.
What I would like to do is show an 'in process' page while the report is processing (some of them take a minute or so) and then come back to the choices page once the report is complete.
If I place the code to make the 'in process' page visible in the onclick, then I don't see the 'in process' page until the report is completed. I've tried setting a session variable and redirecting back to the page and haven't been successful.
Here is the html:
[Code]....
I know I can simply call another page (like I did in the old asp app) but I shouldn't have to do that in .net.
View 1 Replies
Apr 3, 2010
I've developed a popup email .aspx used on our intranet based web app that is auto generated with .pdf's attached. I'm developing with VS 2008 ASP.Net 3.5 C# and System.Net.Mail.MailMessage. I can create and send the email with no issues. The problem is with any attempt to open or delete the attachments I get the above error. The .pdf's a copied with the following code:
FileStream fsr = new FileStream(inFilename, FileMode.Open, FileAccess.Read, FileShare.Read);
BinaryReader reader = new BinaryReader(fsr);
byte[] bytes = new byte[fsr.Length];
reader.Read(bytes, 0, bytes.Length);
FileStream fsw = new FileStream(outFileName, FileMode.Create, FileAccess.Write, FileShare.Write);
BinaryWriter writer = new BinaryWriter(fsw);
writer.Write(bytes, 0, bytes.Length);
// clean up
writer.Flush();
writer.Close();
writer = null;
fsw.Close();
fsw.Dispose();
fsw = null;
reader.Close();
reader = null;
fsr.Close();
fsr.Dispose();
fsr = null;
Later after sending the email I:
mailMessage.Dispose();
mailMessage = null;
foreach (string fileName in attachments)
{
if (File.Exists(fileName))
File.Delete(fileName);
}
The error occurs at: the File.Delete(fileName);
how I can delete or reopen these files after sending the email?
View 9 Replies
Nov 6, 2010
My code is that I want to create a log file and log it upon a new user browsing the site. However, what i did was I put in a 6 second delay and then used another browser to access the page. And it threw an Exception saying it is being used by another process which is true. So how come I set it so that, if IT is being used by another process, WAIT and retry every 500 milliseconds until it becomes free/available?
here's the code:
protected void Page_Load(object sender, EventArgs e)
{if (!IsPostBack) // if this is the first time page loads, set k to 1
{ lognewuser();
}}
[Code]....
View 1 Replies
Jan 6, 2010
I need to accomplish a simple task like this:
1. Assigning text of a few lables to corresponding variables.
2. Taking/posting these variables to server and process them.
3. Print the outcome in a message.
An example would be: Take lable1 as variable x. Take lable2 as variable y. then process as z=x+y. and print z on the page.
View 2 Replies
Sep 7, 2010
I've written a aspx.net(C#) page that after the user has done what they do on the page they hit a Submit button. The Submit button
1) takes the work the users was producing on the page and writes it to a file.
2) attempts to execute a batch file.
The call to the batch file is executed via:
protected void Execute123EDI()
{
try
{
string File = @"c:80sAdminSendV80s.bat";
lblCancelled.Text = lblCancelled.Text + File;
Process proc = new System.Diagnostics.Process();
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.LoadUserProfile = false;
proc.StartInfo.UserName = "administrator";
proc.StartInfo.RedirectStandardOutput = true;
System.Security.SecureString secPass = new System.Security.SecureString();
string paswd = "123abc";
for (int i = 0; i < paswd.Length; i++)
{
secPass.AppendChar(paswd[i]);
}
proc.StartInfo.Password = secPass;
proc.StartInfo.FileName = File;
proc.Start();
FileStream fs = new FileStream(@"c:80sAdminSendV80sOutput.log", FileMode.Append);
StreamWriter sw = new StreamWriter(fs);
sw.Write(proc.StandardOutput.ReadToEnd());
proc.WaitForExit();
sw.Close();
proc.Close();
}
catch(Exception ex)
{
lblDebug.Text = lblDebug.Text + ex.Message + "<br/>";
}
If I watch the processes tab in Task Manager on the web server I see "cmd.exe" under the context of 'administrator' but it just hangs. For test purposes c:SendV80s.bat: copy c: oot.ini c:zzz.txt
If I logon onto the webserver's console and execute SendV80s.bat it works and exits without issue. But when I execute the same batch file via the Submit button it gets stuck executing in Task Manager/Process. I believe this has something to do with the fact that cmd is not running in a full environment/desktop context. I just noticed this on the actual console of the webserver (not in my RDP console but console 0 instead)
A pop-up box stating: CMD.exe Application error The application failed to initialize properly (0xc0000142). Click OK to terminate the application. And when I click on the OK button my ASPX page's WaitForExit is satisfied and the continues processing normally.
View 2 Replies
Feb 26, 2010
I'm working on an ASP.net app I'm trying to execute a process remotely , using System.Diagnostics.Process class here's my code:
ProcessStartInfo startInfo = new ProcessStartInfo(@"C:TestCommand.exe");
startInfo.Domain = "myDomain";
startInfo.UserName = "MyUserName";
SecureString sec = new SecureString();
foreach (char item in "MyPassword")
{
sec.AppendChar(item);
}
sec.MakeReadOnly();
startInfo.Password = sec;
startInfo.UseShellExecute = false;
Process.Start(startInfo);
I keep receiving an exception with the message "Logon failure: unknown user name or bad password". Im absolutelly sure that i'm submiting my correct username/pwd
View 1 Replies
Dec 25, 2010
Dear ladies and sirs.
I have a .NET infra code running both within the IIS worker process and within a desktop client app. How can the .NET code determine whether it is running within an IIS worker process?
I know that I could check the name of the process (w3wp.exe, for instance), but I would like a more robust approach. I wish to make a side note. This is not a production need. I need this information to enable certain scenarios useful during the development and testing phase. Specifically to ease the testing of secure vs non secure configurations.
View 3 Replies
Jan 26, 2010
When I hit the run button (in my Default.aspx), a process starts (this process contacts a webservice to get some files, etc). How do I: Ensure that only a single process is running at a time (i.e. if I refresh the browser, I don't want to start the process a second time)Track progress - there are 4 points of the process (at 25%, 50%, 75%, 100%) that I want to track, and when each part completes, I want to update the progress bar. I have a status object for the running process, but the question is how to update the progress bar automatically? Do I need to use threads to achieve the above two?
View 1 Replies
Mar 28, 2011
I am having the text file which is used to track all the ip address which is available in the network and replace the content from"Reply from 172.29.116.3: bytes=32 time=1ms TTL=255" to 172.29.116.3.
For this task i am having 2 functions 1.runCMD() Function is used to create a file which ping all the ip address between 3 to 254 ("Reply from 172.29.116.3: bytes=32 time=1ms TTL=255").
2.Another function textFileReplace() which is used to replace the text from "Reply from 172.29.116.3: bytes=32 time=1ms TTL=255" to 172.29.116.3.
This process will continue every 30 minutes..
But i am having the error while accessing the function textFileReplace() as The process cannot access the file 'C:inetpub' because it is being used by another process.
View 4 Replies