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 ?
According to MSDN and the MCTS self-paced training, asp.net can use Hidden fields for client-side state management. The book material goes on to say view-state is more secure than hidden fields because the data is encrypted. I must be missing something here. I setup a Label and made it hidden. I can store data in this hidden label and it won't even be sent to the client browser. This not only works like server side state (note the runat=server), but this seems more secure than view-state because there's no need for encryption as the client can't even see the field.
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:
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.
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.
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.
a) In Asp.Net we can check whether a request is a postback or not via Page.IsPostBack property.But where does this property get its value from? Thus, where in the incoming request does browser put this value? b) As far as I can tell, hitting a reload button also causes browser to send form data back to the server. Thus, is under the hood hitting browser's reload button same as pressing a submit button ( which is nested within a FORM element)?c) Assuming browser displays A.aspx for the fist time and assuming user clicks browser's reload button, then I would think this request will be considered as a postback by Asp.Net (especially since browser also sends back any form data), but it's not.
(probably a bot) sent a request with the following URL to my ASP.NET 4.0 web forms application (running on IIS 7.0):http://ipaddress-of-my-applications-domain/bla1.bla2.bla3.bla4.bla5:)This caused an System.Web.HttpException. I received a logging email from ASP.NET HealthMonitoring I had configured, telling me:A potentially dangerous Request.Path value was detected from the client (:).
Why is a colon in the URL "potentially dangerous"? What dangerous things can be done with such a URL? Do I have any security hole here I am not aware of?
I'm trying to access text from a ButtonField(databound), but I can't get the text if I refer to it as a TableCell. What can I do to get its text?Markup:
PRB .NET User controls is considered published by an "Unknown Publisher" from my ASP.NET pages.We have a .NET User conrol, based off the UserControl class and coupled with the IObjectSafety interface that generates a "Unkown Publisher" warning message when our control is deployed from our ASP.NET applications. The warning pops up as a dialog from the browser, asking the user if they want to install our control, saying that it is from an "Unknown Publisher".1) Our <OBJECT> tag is scripted correctly in our page as such:
I'm having trouble understanding when the site is considered "pre-compiled". As I understand what I've read, if I use the Publish or Build Deployment Package options from within Visual Studio then it is pre-compiling, but if I just use something like xcopy, then it is not pre-compiled.
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?
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:
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.
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.
I have a thread that runs querying a DB and returning some values. If this values satisfyes a condition, I want to raise a message box (javascript alert) for the client side.
In my system, users can post some tasks in DB, and the thread is going to constantly query the database to check if user has things to do. If user has, the system must alert him through a message box.
I've done javascripts invokings with ClientScript.RegisterStartupScript, and Attributes.Add for buttons. But now I want to call the javascript functions (wich will alert the user that he has things to do) from the midle of a sub (that is executed in a thread), without a submit, load or click event. How can I do it?
I'm developing an ASP.NET forms webapplication using C#. I have a method which creates a new Order for a customer. It looks similar to this; private string CreateOrder(string userName) { // Fetch current order Order order = FetchOrder(userName);[code]....
The problem here is, it is possible that 1 customer in two requests (threads) could cause this method to be called twice while another thread is also inside this method. This can cause two orders to be created.
How can I properly lock this method, so it can only be executed by one thread at a time per customer?