C# - How To Progress Status From A New Thread
Jan 21, 2010
I am executing time consuming task in a new thread. ParameterizedThreadStart pts = new ParameterizedThreadStart(WorkingFoo); Thread thread = new Thread(pts);
The WorkingFoo executing the task and keeps track of the progress steps (it can return the total number of "steps" and the current step).
I want to display this information in a progress bar (simple div or ajax control, I don't mind).
I don't want, ofcourse, visually refresh the page that will display the progress. Also I want to reduce as much as possible the number of postbacks. So how do I do that? How to show the current progress from new thread on the web page? Also the page that shows the progress can be closed and re-opned and still get the current status.
View 1 Replies
Similar Messages:
Jan 22, 2010
I want to update my UI with work-progress within a thread. So i am planing to call webmethod every 2 seconds to get the current progress status. This is my code but I can not complete it.
[Code].....
View 1 Replies
Apr 29, 2010
I am doing so many process in a single button click.It is taking more time.So I want to show a progress bar with percentage or status of the process.Is there any way to implement this.
View 2 Replies
Feb 7, 2011
I want to know how to show the progress bar in WEB while updating the status of progress bar percentage and Status of the application I am trying to built a web application in which I update the scripts from SQLServer to another SQLServer using TransactionScope using Stored Procedures. Here in my app I want to show the progress bar. and its percentage completion of the SP or task and simultaneously updates of the scripts execution.
i.e., Table 1 created, Table2 creation in progress like that or updates etc. Status of application.
View 4 Replies
Nov 15, 2010
I'm the first time using VS2010 deployment tool. I selected FTP publish, and all the configurations are correct. I'm just confused that after I clicked publish, there is no window or text shows the status of the uploading progress. When would it be finished? It's taking so long, and in the meantime I can't do anything.
View 2 Replies
Oct 24, 2010
I have a process that retrieves html from a remote site and parses it. I pass several URL's into the method, so I would like to ajaxify the process and give a screen notification each time a URL completes parsing. For example, this is what I am trying to do:
List<string> urls = ...//load up with arbitary # of urls
foreach (var url in urls)
{
string html = GetContent(url);
//DO SOMETHING
//COMPLETED.. SEND NOTIFICATION TO SCREEN (HOW DO I DO THIS)
}
public static string GetContent(string url)
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.Method = "GET"
using (var stream = request.GetResponse().GetResponseStream())
{
using (var reader = new StreamReader(stream, Encoding.UTF8))
{
return reader.ReadToEnd();
}
}
}
In each iteration in the loop, I want to show the URL was completed and moving on to the next one. How can I accomplish this?
View 1 Replies
Apr 2, 2010
I want to remove checked items from checklistbox (winform control) in class file method which i am calling asynchronously using deletegate. but it showing me this error message:-
Cross-thread operation not valid: Control 'checkedListBox1' accessed from a thread other than the thread it was created on.
i have tried invoke required but again got the same error. Sample code is below:
[code]....
View 1 Replies
Jan 27, 2010
How can we debbug a multi-thread program to see local variables of each thread using visual studio 2008.
View 1 Replies
Nov 24, 2010
I'm new to threading and have used it successfully, but limited. I can spawn a thread and have the main thread reference variables in the spawned thread, but I don't know how to allow the spawned thread to reference (and update) variables in the main thread.
Any example threading code I've seen on the web appears to be WAY more complicated than what I do, so I am unable to understand or integrate into my code.
Here is a quick example of how I use threading:
[code].....
View 3 Replies
Mar 24, 2010
I am reading the Asp.net security documentation on msdn.I come across these tow terms and get really confused.
# WindowsIdentity = WindowsIdentity.GetCurrent()
which returns the identity of the security context of the currently executing Win32 thread.
# Thread = Thread.CurrentPrincipal
which returns the principal of the currently executing .NET thread which rides on top of the Win32 thread.
View 1 Replies
Jun 25, 2010
I have a password page and when someone enters an incorrect password I want to simply foil a brute force attack by having
bool isGoodPassword = (password == expected_password);
lock (this)
{
if (!isGoodPassword)
Thread.Sleep(2000);
}
I would expect that this would allow all correct passwords without stalling, but if one user enters a bad password another successful password from a different user would also be blocked. However, the lock doesn't seem to lock across ASP.NET threads.
View 4 Replies
Aug 27, 2010
I want a example of multithreading .i want to use it in a web form not on console.i am using C#.net .and how to use thread.sleep method for a particular thread.
View 5 Replies
Apr 14, 2010
I'm trying to make a progress bar that updates the user on the progress of the AJAX call.
My immediate thinking was that I need an AJAX call to start a thread on the server, allowing the starting AJAX call to finish, and allowing the thread to send updates back to the user.
For the purpose of simplicity, disregard the actual progress bar functionality (I was thinking of implementing one of those JS bars, with fancy colors and effects ;), but if I can get an update from the thread, then updating a simple JS progress bar becomes trivial ;) )
View 1 Replies
Feb 16, 2010
I have a wierd issue with the update progress control in ie8. I have a modal popup that loads a pdf in an iframe, then i have a button click that navigates away from the pdf and shows a form in the same modal. All this is wrapped in an update panel, which i have an update progress control associated with. The control shows correctly in ie7, firefox, safari, and chrome. But in ie8 when the async post back is complete the progress indicator does not hide, until I click on the screen or scroll the page, then it hides and the form shows.
View 3 Replies
Mar 28, 2011
I have to add a progress bar on my web page to show the progress of submission. My page on submit saves the data in the database. I have to show user how long will the submission take place. For an e.g., 50% Completed and so on..
View 4 Replies
Feb 25, 2010
I have a registration page with a SUBMIT button..so whenever user presses SUBMIT, I want to disable that button and show a progress bar with "registration in progress" message, so that user wont be able to press the submit button multiple times when the registration is going on..
View 3 Replies
Jan 9, 2011
I'm writing an HTTP handler in ASP.NET 4.0 and IIS7 and I need to generate a file-not-found condition.
I copied the following code from Mathew McDonald's new book, Pro ASP.Net 4 in C# 2010. (The response variable is an instance of the current HttpResponse.)
response.Status = "File not found";
response.StatusCode = 404;
However, I found that the first line generates the run-time error HTTP status string is not valid.
If, instead of the lines above, I use the following:
response.Status = "404 Not found";
Then everything seems to work fine. In fact, I even see that response.StatusCode is set to 404 automatically.
My problem is that I don't want this to fail on the production server. So I'd feel much better if I could understand the "correct" way to accomplish this. Why did the first approach work for Mathew McDonald but not for me? And is the second approach always going to be reliable?
View 1 Replies
Jul 13, 2010
A little stuck on this one:jQuery ajax message sent to the ASP.NET page with calls a WebMethod. The WebMethod creates an Zipper object that zips up a folder specified in the ajax message. I want to be able to pass data back to the client as to the progress of the zipping.I have this data in the Zipper object but I don't know how to pass it back.
View 3 Replies
Sep 7, 2010
I've got a plain C# web page that uses jQuery to call a handler page using AJAX. While the handler content is loading, a message "Please Wait, loading..." is displayed. Once I've got the content back from the handler I hide the loading message and display the content.What I'd like to do is after the loading message, display a percentage of how far through the handler page is. All the handler page does is loop through a list of members, powered by a web service, and adds them to the database so I know exactly how many members are being added to the database so I can tell how far I am through.The problem I'm having is because all of this goes on in a handler, how can I send the progress percentage back to the main web page while the handler was still loading.Any ideas? If I could do the exact same task but differently which would allow me to create the progress bar,
View 2 Replies
Oct 1, 2010
i am developing an online mmorpg game . so speed is very important . i have a complex map system which is coded by me . at this map system for walking i am using ajax . using iis 7.5 and netframework 3.5 .
at this page you can use w,a,s,d or keyboard arrow keys for walking [URL] ( username : test1234 , password : test1234 )
as you can see at image below when a player pushes the movement buttons faster ( without waiting to move completed ) status being aborted so it really prevents walking faster i want to prevent this is from happening ( disable buttons to be pushed so fast until post event completed )
[Code]....
[Code]....
View 2 Replies
Jan 2, 2011
I need an explanation regarding some advice I got on this site. I'm doing a newsletter sending app, and I have my mail sent in a seperate thread so the process doesn't slow down the whole web site. A couple of people advised me to set the threads IsBackground property to true. I did this, but was also courious about what this does, so I googled a bit.
As it turns out, setting the IsBackground property to true indicates that "it's okay if the process shuts down while this thread is still running.". Or as microsoft puts it "Any remaining background threads are stopped and do not complete." I don't know if I got this the wrong way but, wouldn't it be better to leave the IsBackground property to false, so that the spawned thread can complete its work regarding the main thread?
View 2 Replies
May 8, 2010
I want to execute a process, but after the process is done i would like to execute a query so i know this process is done.The process called ffmpeg is quite big so i start it and wait til its done with this coding:
ffmpeg.Start(); // start !
View 5 Replies
May 18, 2010
after invoking an async method using ThreadPool.QueueUserWorkItem how do i lookup the assigned thread id?
View 4 Replies
Apr 3, 2010
So basically here I am trying to wait for my server to connect to my website signaling it that its done and so the page needs to be refreshed(cause sql was updated). Thing is when I try to use the response/request in the thread it simply doesn't want to work.
Here the code
Code:
[code]....
Errors I am getting are:
1. If I have the headers clear thing there it gives requires integrated IIS pipes or something like that.
2.If I don't have the clear headers it says the headers were already sent.
View 13 Replies
Feb 24, 2011
Can we consider that two clients accessing the same method of a web service at the same time are two threads (with all problems involved...) ?Is it the same thing for methods in an asp.net web application ?
View 3 Replies