.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> JavaScript/VBScript >> Post New QuestionBookmark and Share Subscribe to Forum

Javascript to ask confirmation before saving to database

Posted By: Naresh     Posted Date: January 19, 2010    Points:2   Category :JavaScript/VBScript
hi,
i have a table, where i will store the details getting from the customer. Before saving i have to confirm from them whether they want to store, if yes, datas must be stored to database. i want a javascript, to get confirmation from the user.

thanks in advance for the answer.

Responses
Author: Lalij Mer             
Posted Date: January 19, 2010     Points: 5   

use this code sample

<script language ="javascript" type ="text/javascript">
function check()
{
return confirm ("Are you sure to Save this");
}
</script>
Now call this function in code behind (in .cs page).

btnSave.Attributes.Add("onClick", "return check();");


Please Check my answer if you help....
Thank You...

Lalit.


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend