Click here to Skip to main content
11,569,945 members (58,956 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: ASP.NET
i want to dispaly message box using java script on clicked on button that "Data Saved Sucessfully".
Manohar Khilare
Posted 24-Jan-13 1:42am
Vani Kulkarni at 24-Jan-13 7:51am
ok, so what is the question?
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Hello freind,

if you want to show message after finishing your work from code behind then use this syntax at the end of your buttong click event last line.

protected void btnJavasctiptAlert_Click(object sender, EventArgs e)
     //other work code here
     //like insert data code goes here
     ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "anything", "alert('Data Saved Sucessfully');", true);

or just simply want to add javascript mesage from design side then use like this...

<asp:button id="btn" runat="server" text="Javascript Click" onclientclick="javascript:alert('Data Saved Sucessfully');" xmlns:asp="#unknown" />
ridoy at 24-Jan-13 13:35pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

A pretty vague question. But still here's I think what you can do.

I'm pretty sure you want to show this message after actually saving the data...Smile | :) If you are saving the data asynchronously using jquery or .Net Page can write your code at the end of success method.

You can use jquery dialog for showing the message. It's pretty easy to implement also.

<asp:button id="btn" runat="server" text="Javascript Click" onclientclick="javascript:SaveData(a);" xmlns:asp="#unknown" />

function SaveData(a){
if (typeof a !== "undefined"){
   PageMethods.SaveData(a,savesuccess,savefailed);//you can use the jQuery syntax also here if you are using webservice to save the data.
function savesuccess(){
    alert('Data Saved');
function savefailed(){
   alert('Save Failed');

If this is not what you are looking perhaps changing the question would help. Smile | :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS

Advertise | Privacy | Mobile
Web03 | 2.8.150624.2 | Last Updated 24 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100