Quote:
quote:Originally posted by planoie
You have placed javascript in regular code. The compiler doesn't like it.
You can wrap your javascript tags inside a call to the method that will drop it in the page's HTML:
RegisterStartupScript("<script...>...</script>")
|
Thanks for the suggestion. Sorry I couldn't respond sooner, I was out of the office all last week.
I inserted the following lines of code after the code for Parameter10:
<code>
Dim strScript1 As String
Dim strScript2 As String
strScript1 = "<script language='javascript'>" & _
"alert('The ProjectID you entered is already used in the database. Please try a different Project ID.');" & _
"& chr(60) & "</script>"
strScript2 = "<script language='javascript'>" & _
"alert('A SQL Server Error Occurred.');" & _
"& chr(60) & "/script>"
Page.RegisterStartupScript("strScript1", strScript1)
Page.RegisterStartupScript("strScript2", strScript2)
</code>
Now I have a different error:
Compiler Error Message: BC30289: Statement cannot appear within a method body. End of method assumed.
Source Error:
Line 293: #End ExternalSource
Line 294:
Line 295: Public Sub New()
Line 296: MyBase.New
Line 297: Dim dependencies As System.Collections.ArrayList
Source File: C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Tempo rary ASP.NET Files\burs\06db06a6\5c2ffd47\a43u_k4r.0.
vb Line: 295
Any suggestions on this error?