I was playing with this a little just now.
If you include the Import directive just after the Page directive in your
ASPX file, it should do what you want.
<% Page Language="vb" Codebehind="page1.aspx.vb"
<% Import namespace="webproject" %>
Where the name of my ASP.NET project is 'webproject'.
Unfortunately you then get a BC30561 compile error: 'Trim is ambiguous,
imported from the namespaces or types 'Microsoft.VisualBasic.Strings,
You will need to change the name of your Trim function, or add Trim as a
method to the base class for your page.
page1.aspx inherits from class page1 in page1.aspx.vb
class page1 inherits from class BasePage in BasePage.vb
class BasePage inherits from System.Web.UI.Page
Then add your Trim function to the BasePage class. The BasePage class can
contain all the functionality (VB code) that is common across all pages. It
cannot contain common ASPX code.
Wouldn't it be easier to modify your retrieves from the database to avoid
returning NULL values? Put the check for NULL in the Stored Procedure or
Select statement you are using. Then your ASPX can simply use the values
instead of need to worry about NULLs...
Hope this helps
"Stephajn Craig" <com> wrote in message