Javascript Alert Does not work on Firefox and Chrome

Asked

Viewed 407 times

4

I’m trying to generate a wrong password alert in Javascript. It’s for a web application that works on .net. This alert works on IE, but we are porting the system and wanted it to work on both IE and Firefox and Chrome.

ClientScript.RegisterStartupScript(this.GetType(), "js", "alert('Senha incorreta para o usuário " + txtLogin.Text + "');", true);
  • Check if the browsers are javascript enabled, or better, try running your application on another pc and see if the error persists.

  • Javascript is already enabled in the browsers, so much so that other features of js work. It has also been tested on another pc, error continues. I believe it is some specification of this command.

  • Is there an error message? Does the code appear in the body of the page? Have you tried putting javascript:alert? And add the tag <script> and set the next parameter as false? Are some solutions I found on the net.

  • I tried all these possible combinations.

1 answer

1

I decided to change the command, continuing thinking that this command Registerstartupscript does not exist in firefox and Chrome. Now I’ve switched to:

ClientScript.RegisterClientScriptBlock(this.GetType(), "script", "alert('Senha incorreta para o usuário " + txtLogin.Text + "');", true);

Browser other questions tagged

You are not signed in. Login or sign up in order to post.