I am using below code for javascript window “Yes/No”. It is firing twice. Is there any way I can avoid this? Or use any other code?. I need this code behind.
Response.Write("<script language='javascript'> { self.close() }</script>");
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It looks like you’re using
Response.Writewhere it would end up at the bottom of the page, like this:This will give all sorts of funky behavior, instead use
ClientScript.RegisterStartupScript, like this:If you were using update panels (which doesn’t seem the case from
Response.Write()) you would use the similarScriptManager.RegisterStartupScript()method.