C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days 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     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

Author: arjun    12 Jul 2006Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

Hi

try with asynchronous method in .net

arjun-



Author: Sushweta Biswas    13 Jul 2006Member Level: BronzeRating: 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: JavaScript

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use