Click here to Skip to main content
15,891,253 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using .net 1.1 and visual studio 2003 version.

I need c# code to show the alert window for display the message after click the button(save).

I am trying below the code.it is not working....

page.ClientScript.RegisterClientScriptBlock(typeof(Alert), "alert", script);

if any one know the code to display the alert window in c# framework 1.1

help me........
Posted
Comments
Christian Graus 21-May-10 9:07am    
You should edit your question to make it clearer, not ask it again.

1 solution

sethupathiram wrote:
page.ClientScript.RegisterClientScriptBlock(typeof(Alert), "alert", script);


Try:
C#
btnSave.Attributes.Add("onclick", "alert('Hi There!');");


UPDATE:
For showing alert from server side after some operation, try:
C#
string script = "alert('Hi There2!');";
Page.ClientScript.RegisterClientScriptBlock(Page, this.GetType(), "ShowAlert", script, true);
 
Share this answer
 
v2
Comments
Christian Graus 21-May-10 9:07am    
This will not work, he wants to show a message after a postback, not instead of one.

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900