Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How Do You add NameSpace lines to the CodeBehind Module 1

Status
Not open for further replies.

johnfrederick

Programmer
Sep 30, 2002
34
0
0
US
I've tried to put my code in the CodeBehind module, but when it needs NameSpace lines, e.g., for I/O, I can't figure out where to put them to avoid an error message. Event routines not requiring NameSpace lines are ok. Can anyone advise?
 
Hey John,

Not really clear on what sort of namespace lines you're talking about, so hopefully something below will be of help:

If you're tyring to encapsulate code within a namespace:
Just add "Namespace MYNAMESPACENAME" and "END NAMESPACE" around the code that you want inside the namespace
i.e.
Namespace MySpace

'put code here

End Namespace

If you're trying to use classes from a certain namespace:
At the beginning of your code page (whether a module or a class), put "Imports NamespaceToImport".
i.e.
Imports MySpaces.Spaces
Class MyClass
'class code
End Class

Does that answer your question?

D'Arcy
 
Thanks, jfrost10, for your help. It looks like you have the right answer. I put:

Imports System.Data
Imports System.Data.OleDb
Public Class DeliveryList3LoadsDeliveryListAndMsgs
Inherits System.Web.UI.MobileControls.MobilePage

With some OleDb I/O code in the Page_Load event routine, it compiled with no error messages which is farther than I had gotten before. I haven't tried to run the code, but this looks promising. Thanks again for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top