Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > @Import Syntax and Importing Namespaces in global.asax file

Reply
Thread Tools

@Import Syntax and Importing Namespaces in global.asax file

 
 
D. Shane Fowlkes
Guest
Posts: n/a
 
      01-13-2004
Tw part question:
1 - Is it <% @Import Namespace..... or <%@ Import Namespace... ? I'm seeing
it both ways in a book (but I think one is a typo. My pages don't seem to
care which it is. Or do they?....see below

2 - I'm trying to import the namespaces of System.Data and
System.Data.SQLClient in the global.asax file so I don't have to do this on
each page using SQL Server commands and data. But it doesn't seem to work.
I read you can do this. What's the trick if it's possible to do this? My
@Imports are above my <script> tag in the asax file like so:

<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>


<script language="vb" runat="server">
Sub Session_OnStart
....etc

Thanks guys!


 
Reply With Quote
 
 
 
 
Tu-Thach
Guest
Posts: n/a
 
      01-13-2004
inline

>-----Original Message-----
>Tw part question:
>1 - Is it <% @Import Namespace..... or <%@ Import

Namespace... ? I'm seeing
>it both ways in a book (but I think one is a typo. My

pages don't seem to
>care which it is. Or do they?....see below


I don't think it matters.

>2 - I'm trying to import the namespaces of System.Data and
>System.Data.SQLClient in the global.asax file so I don't

have to do this on
>each page using SQL Server commands and data. But it

doesn't seem to work.
>I read you can do this. What's the trick if it's possible

to do this? My
>@Imports are above my <script> tag in the asax file like

so:
>
><%@ Import Namespace="System.Data" %>
><%@ Import Namespace="System.Data.SqlClient" %>
>
>
><script language="vb" runat="server">
>Sub Session_OnStart
>....etc
>


You have to import it into each individual page.

Tu-Thach
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Importing namespaces in a class Ralph Wiggum ASP .Net 7 01-23-2008 10:48 PM
combining namespaces when importing two modules Donnal Walter Python 1 08-22-2005 09:04 PM
Explicit or general importing of namespaces? Harlin Seritt Python 10 03-05-2005 12:18 AM
How to keep a module with the same name as a module it is importing from importing itself? plb Python 2 02-08-2005 03:14 PM
newbie - help - where do u store custom classes when importing namespaces in ASP ravi sankar ASP .Net 2 08-27-2003 10:39 AM



Advertisments