Re: Problem with Response.Write("<script>alert('" + errorMessage + "')

  • Thread starter William F. Robertson, Jr.
  • Start date
W

William F. Robertson, Jr.

What does the "View Source" look like when the page hits your browser?

I did notice you don't have a language defined for your script tag, and you
are missing your semi colon on your statement.

bill
 
G

Guest

Willam,
Thank you for your response.
The language is defined in the header of the html file (as shown
below).However you mentioned that i am missing a semi colon in my
statement,where?
<HEAD>
<title>BasicInformation</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
 
W

William F. Robertson, Jr.

By using Response.Write (instead of Page.RegisterStartUpScript() ), it will
write out the <script> tags before the <HEAD> tags gets sent to the browser.
The browser will try to process it before it knows exactly what to do with
it. I not saying this is you problem, just something I would suggest
fixing.

The semi-colon is missing at the end of your alert statement.

Response.Write( "<script
language=\"javascript\">\nalert('message');\n</script>\n" );

If this still doesn't help, post a snippet of your "View Source" that is
working correctly and is not.

HTH,

bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top