|
Hi ,
I want to clear all my session variables when the page terminates.
I tried page_unload , but then for every refresh (submit) of the page,
control goes to this function?
How I can have a function which only executes at the page termination?
regards
Vijay
|
|
|
|
|
vjvjvjvj wrote: I tried page_unload , but then for every refresh (submit) of the page,
control goes to this function
You haven't taken time to read the documentation. It explains what page_unload does and the behaviour you are getting is how it works.
vjvjvjvj wrote: How I can have a function which only executes at the page termination?
What do you meant by "page termination" ? When someone tries to close the browser ?
|
|
|
|
|
yes when the browser window for the page is closed, i want to clear the session variables for the form.
regards
Vijay
|
|
|
|
|
use Global.asax file , use Session_End() to Session Abandon. Call when you terminating the page.
Now, you can do it from you application easily, but how to do in Browser Close, there are some Trick. First try it. then I can help you
cheers,
Abhijit
|
|
|
|
|
Hi Abhijit,
I can not use session_end. I am not exiting my session. I am just terminating a page from my session and I want to find out where I can catch this.
I tried javascript onUnload but it goes there everytime the postback happens
regards
Vijay
|
|
|
|
|
vjvjvjvj wrote: I tried javascript onUnload but it goes there everytime the postback happens
yes , Page_unload Called on every post back.
use one condition to check clientX and clientY , it should be negative when you click [X] , File -> Close and Alt + 4 else it should be postive.
so just check that condition
Hope you have got my point.
cheers,
Abhijit
|
|
|
|
|
yes I got it.
Thanks Abhijit,
regards
Vijay
|
|
|
|
|
Hi,
I have a shared variable (hashtable) for my form class DataEntry.
I have defined it as
public shared oHashNoteStore as HashTable
The reason I defined it as shared is, every time my form is submitted the hashtable was getting initiated and all the values stored in it were getting lost. (Protected oHashNoteStore as HashTable)
My Question is
In multi user environment , will this shared environment will be shared (which I do not want) ?
Say user A adds four values in the shared hash table from the page class on Machine A ,
will user B will have same values seen for hash table.
If this undesired effect occurs what is the workaround for the given scenario without losing current functionality. How I can mantain the hash table without losing its values between the page refresh.
regards
Vijay
|
|
|
|
|
vjvjvjvj wrote: Say user A adds four values in the shared hash table from the page class on Machine A ,
will user B will have same values seen for hash table.
YES.
vjvjvjvj wrote: If this undesired effect occurs what is the workaround for the given scenario without losing current functionality. How I can mantain the hash table without losing its values between the page refresh.
This is how static(shared) works. It's value will be available until application domain unloads.
You need to keep the hashtable instance in a session so that you won't loose the data in it and each user will get their own copy.
|
|
|
|
|
Hi Navneeth,
Yes I was caught there.
Now I have to use session variable to maintain my hashtable acros the postbacks.
regards
Vijay
|
|
|
|
|
Extract video file from email inbox automatically and insert data into database after just receiving mail in inbox.
This method widely used to upload video from mobile browser.
for example youTube used this method.
please don't forget to vote on the post that helped you.
|
|
|
|
|
Good, but what's your question ?
|
|
|
|
|
Please help me with a regular expression for Indian Fax Number validation.
Thanks
|
|
|
|
|
Please use the Link for your help
regexlib.com/DisplayPatterns.aspx
Cheers!!
Brij
|
|
|
|
|
is there a refresh method for window.opener.location class.
the one below is reloading the whole page but i just want a postback
if (window.opener && !window.opener.closed)
{
window.opener.location.reload();
}
|
|
|
|
|
You can do as below
if (window.opener && !window.opener.closed)
{
window.opener.location.href = window.opener.location.href;
}
It'll postback the page.
Cheers!!
Brij
|
|
|
|
|
Hi omlac
There is no Refresh mthod available in Javascript. Better you try the following code
location.href="mention the same page name";
R.Palanivel 10:01 4 Jan '06
modified on Tuesday, August 19, 2008 8:08 AM
|
|
|
|
|
Hie, it reloaded the page again,
is there anything else i have to do besides adding your code.
|
|
|
|
|
If you want a postback, then just use formName.Submit(); or look into the __doPostBack() function.
|
|
|
|
|
Hi I have a calendar control appearing in a pop up window and what I would like is for the user to select a data from the calendar and it is returned to the page from which the calendar popup was opened. What would be the best way at doing this as I have found some techniques but neither have the knowledge or they don't seem to work.
Any help is appreciated
"When will I learn? The answers to life's problems aren't at the bottom of a bottle. They're on TV" - Homer Simpson
|
|
|
|
|
you have to do it using java script.
window.opener.document.getElementById(window.opener.ParentControlID).value = CalendarVal.value;
take Calendar value in a client side variable CalendarVal and ParentControlID is the ID of your parent window that where you want to display.
Hope this will resolve your problem !!!
cheers,
Abhijit
|
|
|
|
|
Hmm I have tried to implement this way but am not too sure where to start as I'm not a big javascript person. Do I need to add it to a function and then call the function from the calendar change event.
"When will I learn? The answers to life's problems aren't at the bottom of a bottle. They're on TV" - Homer Simpson
|
|
|
|
|
Since posting that I have since got it to work. Thank you for the help.
"When will I learn? The answers to life's problems aren't at the bottom of a bottle. They're on TV" - Homer Simpson
|
|
|
|
|
Ok this is annoying I have it working in vb.net but not working in c# i have gone through and made sure that it is putting the name of the text box of where the value is to go in the correct palce and it all seems to be fine, but when the user selects a date it closes the calendar but doesn't put the value in the text box.
protected void Change_Date(object sender, System.EventArgs e)
{
string strScript = "<script>window.opener.document.forms(0)." + control.Value + ".Text = '";
strScript += calDate.SelectedDate.ToString("MM/dd/yyyy");
strScript += "';self.close()";
strScript += "</" + "script>";
RegisterClientScriptBlock("anything", strScript);
}
"When will I learn? The answers to life's problems aren't at the bottom of a bottle. They're on TV" - Homer Simpson
|
|
|
|
|
are you talking about vb.net or C# ?
One Tips : while adding string use StringBuilder. this is good practice and good for membory also.
cheers,
Abhijit
|
|
|
|