Click here to Skip to main content
15,889,200 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have been checked


VB
ScriptManager.RegisterClientScriptBlock(Me, GetType(Page), UniqueID, "javascript:alert('You have registered Successfully!');", True)

     Response.Write("<script>alert('registrationsuccessful')</script>")
ScriptManager.RegisterStartupScript(Me, Me.[GetType](), "script", "alert('Message')", True)






i want to give a message box after register
plz help
Posted
Updated 16-Apr-14 18:58pm
v2
Comments
Tom Marvolo Riddle 17-Apr-14 0:19am    
Dio you want to show? this (You have registered Successfully) after registration
neeraj_ 17-Apr-14 0:22am    
yes sir
Tom Marvolo Riddle 17-Apr-14 0:25am    
try this:
ScriptManager.RegisterStartupScript(Me, Me.[GetType](), "script", "alert('Message')", True)
neeraj_ 17-Apr-14 0:46am    
its not working sir
Sanket Saxena 17-Apr-14 0:54am    
are u using update panel???

C#
ScriptManager.RegisterStartupScript(Me, Me.[GetType](), "script", "success('Message')", True)

JavaScript
function success(Message)
{
alert(Message);
window.location = 'newpage.aspx';
}
 
Share this answer
 
v2
Comments
neeraj_ 17-Apr-14 0:52am    
i've been checked it out but this was not helpful
ravikhoda 17-Apr-14 0:53am    
please check console if you get any error over there ?
neeraj_ 17-Apr-14 1:14am    
no error there
ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('This is an alert');", true);
 
Share this answer
 
Comments
neeraj_ 17-Apr-14 7:27am    
its not working sir
jacobjohn196 17-Apr-14 8:30am    
protected void btnAlert_Click(object sender, EventArgs e)
{
ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('This is an alert');", true);
}
This should work.

If this is not working, Check your browser setting.
neeraj_ 18-Apr-14 0:20am    
what should be at
get type()
error is- type expected
neeraj_ 18-Apr-14 0:20am    
what should be at
get type()
error is- type expected
use something like this:

System.Web.HttpContext.Current.Response.Write("<SCRIPT LANGUAGE=""JavaScript"">alert("Hello this is an Alert")</SCRIPT>")

-SG
 
Share this answer
 
Comments
neeraj_ 17-Apr-14 4:25am    
this is flash an error
comma or a valid expression continuation expected
neeraj_ 17-Apr-14 4:35am    
not working sir

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