I'm a newbie to ASP.NET and
VB.NET, and I'm trying to develope a way to include an external script file to a central ASP.NET page. After doing some research, I found information on the ClientScriptManager.RegisterClientScriptInclude Method at
http://msdn2.microsoft.com/en-us/library/2552td66.aspx.
So this is what I developed for my page:
Code:
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" AspCompat="true" Debug="true" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System" %>
<%@ import Namespace="System.IO" %>
<%@ import Namespace="System.Xml" %>
<%@ import Namespace="System.Text.RegularExpressions" %>
<%@ import Namespace="System.Web.UI" %>
Sub Page_Load(sender As Object, e As EventArgs)
Dim page_path = page_qs 'Querystring variable unique to each page
Dim vbkey As String = page_path
Dim vbpath As String = "http://SERVERNAME/DIRECTORY/bgscripts/vb/vbdoc.vb"
'Define the name, type and url of the client script on the page.
Dim csname As String = vbkey
Dim csurl As String = vbpath
Dim cstype As Type = Me.GetType()
' Get a ClientScriptManager reference from the Page class.
Dim cs As ClientScriptManager = Page.ClientScript
' Check to see if the include script is already registered.
If (Not cs.IsClientScriptIncludeRegistered(cstype, vbkey)) Then
cs.RegisterClientScriptInclude(cstype, vbkey, ResolveClientUrl(vbpath_new))
End If
End Sub
But I'm receving this error message:
Compiler Error Message: BC30002: Type 'ClientScriptManager' is not defined.
I made sure to register the namespace at the top of the page (<%@ import Namespace="System.Web.UI" %>), but I'm still getting the same error. If anyone can help me to figure out what I'm doing wrong, that would be great. Thanks.
KWilliams