I've a datatable whose values need to be maintained across postbacks. (Just single page, not across multiple pages). This datatable is not read only. I mean to say some data can be changed based on user selection during partial postbacks and need to be maintained till the final submit. I declared the datatable as static and could retain the values across partial postbacks. But the problem is that I've always thought that in multiuser environment only one copy of the static variable is created and shared across the users. But my datatable behaves differently.
I opened the page in a browser and pressed Ctrl+N for new window. When I work on both windows, the datatable is not clashed. I mean - changes done in one window is not reflected in the other window. This is the behaviour I want exactly. One user's change should not affect other user. This is a reporting page and I store the user selections in the datatable before the final submit. Based on the options in the datatable, the report is created.
Though I achieve the desired functionality, I am worried whether what I am doing is right. Is it true that a static variable is shared acorss users or not??? Any inputs?
I am using VWD 2008 Express edition and c#.
By my understanding, it depends on the container that you use. If the static variable is contained in a instantiable class then the variable is not shared across users. If it is contained in a static class then it is shared across users. This is just my understanding and there is every possibility that I might be wrong.
A safer and a much cleaner approach to this problem would be to put the datatable in the page's viewstate. This way the datatable along with the changes is available as long as the page is alive and you get peace of mind!
I´m trying to deal with a little problem using Certificates, I have a ASP.NET Website (VB) with the traditional User/Password login. Now I want use SmartCards attached to the Client-Machines. I saw few ASP.NET websites poping up some Windows Dialog for Certificate Selection (NOT a Windows Chalenge Login) it´s just a list of certificates inside the SmartCard CHIP.
Does anyone know how to ask for that Dialog using server side?
I am trying to extend the GridView. I am unable to find out the control placed in the template field and its binding. Is there a way to get to know that? For instance I add a template field as below in the gridview:
I am doing an asp website along with ajax .
actually i am using an asp update panel, in which i am updating some informations based on conditions,
that panel is reffered to as the ajax pop up pop up control control id, and the target control id is a button
it works fine in my local host
here my problem is with the hosted server,
if i click the button it is updating the panel and the pop up is showing, but
the mean time the user is unable to feel what is going on as the page is simply sitting, after 30 secs the pop up is coming.
i want to show an progress bar or image kind of thing,
How to do that, ( as i already try to show some image(like loading) in the ajax pop in an seperate update panel, its also showing same response)
"Sys.WebForms.PageRequestManager" class manages partial-page updates of server UpdatePanel controls in the browser. There are two events which handles before an request made and after completing the request in the browser. These are
1. Sys.WebForms.PageRequestManager beginRequest Event : Raised before processing of an asynchronous postback starts and the postback request is sent to the server.
2. Sys.WebForms.PageRequestManager endRequest Event: Raised after an asynchronous postback is finished and control has been returned to the browser.
You can simply use this events to show and hide your progress bar. See code below
function BeginRequestHandler(sender, args)
var elem = args.get_postBackElement();
ActivateAlertDiv('visible', 'AlertDiv', elem.value + ' processing...');
function EndRequestHandler(sender, args)
ActivateAlertDiv('hidden', 'AlertDiv', '');
function ActivateAlertDiv(visstring, elem, msg)
var adiv = $get(elem);
adiv.style.visibility = visstring;
adiv.innerHTML = msg;