Click here to Skip to main content
15,879,239 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
in my application i am using javascript to show message in popup its working fine in my system
but when am copying my site on server (which has asp.net framework and sql server only )java script is not working i have deployed site on iis7.5
and my code for javascript is
JavaScript
Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "ClientScript", "<script>alert('Data Added Successfully!!'); location.href='../Console/TenderManagement.aspx';</script>");

i really don't have any idea what is wrong in it
plz help
Posted
Comments
Check in console window of FireBug in FireFox, if you have any errors/exceptions.
skantg 7-May-13 9:12am    
this code is working from your machine and not after deploying on server.

Javascript is client side scripting language and depends on machine on which the code is being accessed through browser.

are you accessing this on your server itself? sometimes for security reasons, scripting is disabled on webservers. Try to test it by accessing the URL from some other machine.

I Think u should go with below code
C#
ScriptManager.RegisterStartupScript(Page, typeof(Page), "", "alert('An Unknown error. Please try again ...!!! ');", true);
 
Share this answer
 
v2
Simplest soluton:


C#
Response.Write("<script type='text/javascript'>");
Response.Write("alert('Data Added successfully.');");  
Response.Write("document.location.href='../Console/TenderManagement.aspx';");
Response.Write("</script>");
 
Share this answer
 
v3

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