C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




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


Posted Date: 12 Jul 2006      Total Responses: 1

Posted By: Sushweta Biswas       Member Level: Bronze     Points: 2


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:     Points: 2
Hi

try with asynchronous method in .net

arjun-


Author: Sushweta Biswas    13 Jul 2006Member Level: BronzeRating:     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
You must Sign In to post a response.
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   BizTalk Adaptors    Web Design

internet fax

Contact Us    Privacy Policy    Terms Of Use