Subscribe to Subscribers

Online Members

Kapil
More...

Forums » .NET » JavaScript »

how to run sql before window is closed. URGENT. HELP!


Posted Date: 12 Jul 2006      Posted By:: Sushweta Biswas     Member Level: Bronze    Member Rank: 0     Points: 2   Responses: 1



Hi All,

I have a long form in my web page.

When the users attempt to close the browser window, a confirm box pops up asking them two things: 'Click yes to save and close the window' and 'Click no to close the window without saving'.

with two buttons for yes and no.

Now if the user clicks the yes fast enough, then my sql script to save the data in the form to the database doesn't process completely.

So what i need is to first execute the entire sql script, meanwhile showing a message to the user as saving...., and then close the window.

Thanks for any help.

Sushweta





Responses

#62818    Author: arjun      Member Level: Gold      Member Rank: 0     Date: 12/Jul/2006   Rating: 2 out of 52 out of 5     Points: 2

Hi

try with asynchronous method in .net

arjun-


 
#62865    Author: Sushweta Biswas      Member Level: Bronze      Member Rank: 0     Date: 13/Jul/2006   Rating: 2 out of 52 out of 5     Points: 2

Hi,

I am sorry but i forgot to mention that it's an classic ASP page.
So I'll have to check that all the sql queries have executed and then pop up an alert msg to the user as 'Data Saved Successfully' and close the window.

This is my javascript function:

function returnValue()
{
var sMsg1;
var sMsg2;

sMsg1 = "Click Yes to save and close the survey";
sMsg2 = "Click No to close without saving the survey";

var ch = returnConfirmDialog (sMsg1, sMsg2, 36, "Confirmation");

if (ch == 6)
{
document.forms[0].btnSave.click();
if (bSave == true)
{
alert("Data has been saved successfully");
return true;
}
}
else
{
return;
}
}


Now the issue is how do i make sure that sql queries have executed from my javascript function.

Please help???


 
Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.



Next : It is possible vbscript and javasript in same page
Previous : assigning a value to label from javascript
Return to Discussion Forum
Post New Message
Category:

Related Messages

Active Members
TodayLast 7 Daysmore...

Awards & Gifts
Talk to Webmaster Tony John
Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India
2005 - 2013 All Rights Reserved.
.NET and other trademarks mentioned in this site belong to Microsoft and other respective trademark owners.
Articles, tutorials and all other content offered here is for educational purpose only.
We are not associated with Microsoft or its partners.