Hi Florencio,
You need to include the following at the top of your Code-behind file to provide to the compiler information to know where to find the StringBuilder class:
Imports System.Text
Here is the sample code I provided in VB .NET syntax:
Dim sb As New StringBuilder()
sb.Append("<SCRIPT LANGUAGE = ""JavaScript"">")
sb.Append("self.close();")
sb.Append("</SCRIPT>")
If Not Page.IsStartupScriptRegistered("closewindow") Then
Page.RegisterStartupScript("closewindow", sb.ToString())
End If
>Hi Cathi,
>
>I have a slight problem with your code. First of all I use VB.Net
>in my ASPX Pages and datatype 'StringBuilder' doesn't exist in my Object
>Browser or 'not Recocnized' by my machine.
>
>I think this is only applicable in C#. Do you have an idea that
>can work in VB.Net?
>
>Thanks Regards,
>
>Florencio
-----------------------------------------
Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.comwww.prenia.comWeblog: blogs.prenia.com/cathi