0

asp.net with C#
how to show the message box after saving the data in db(sqlserver)
??
earlier i was using javascript alert like this

<pre lang="xml">public static void ShowMessage(string strMessage,Page pgno)
{
    Label lbl = new Label();
    lbl.Text = &quot;&lt;script type='text/javascript' language='javascript'&gt;&quot; + Environment.NewLine+ &quot;window.alert('&quot; + strMessage + &quot;');&lt;/script&gt;&quot;;
    pgno.Controls.Add(lbl); 
}</pre>

but since putting update panel and asp:updateprogress Its not working.
Is there any ajax message box to use after saving the data.??
I know the "ConfirmButtonExtender"
but can we use it to show the confirmation message after saving the data into db(sqlserver)
Or better 1
thanks in advance

Edited by __avd: Added [code] tags. Encase your code in: [code] and [/code] tags.

2
Contributors
1
Reply
4
Views
7 Years
Discussion Span
Last Post by jbisono
0

I have a common class and one of my method is this one

public static void Message(String message, Control cntrl)
        {
            ScriptManager.RegisterStartupScript(cntrl, cntrl.GetType(), "alert", "alert('" + message + "');", true);
        }

then any time i want to display a message i just call that method like this.

Message("Any message here", this);

hope that help.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.