JavaScript in StringBuilder

badar

New Member
I can't seem to add some javascript to a StringBuilder. I have a working page which generates HTML content in the form of a div tag. This works fine. I just wanted to add a simple script at the end of the StringBuilder so the client side gets an alert when the div tag finishes appearing on the screen, i.e:\[code\]objStringBuilder.Append("<script language='javascript'>")objStringBuilder.Append("alert('Finished');")objStringBuilder.Append("</script>")\[/code\]This gives me an error message in the IDE:\[code\]statement cannot appear within a method body. end of method assumed\[/code\]The error is appearing on the last line:\[code\]objStringBuilder.Append("</script>")\[/code\]It does!This code is done in VB.NET.
 
Back
Top