469,160 Members | 1,877 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,160 developers. It's quick & easy.

@Import Syntax and Importing Namespaces in global.asax file

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!
Nov 18 '05 #1
1 3924
inline
-----Original Message-----
Tw part question:
1 - Is it <% @Import Namespace..... or <%@ Import Namespace... ? I'm seeingit both ways in a book (but I think one is a typo. My pages don't seem tocare 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 oneach 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
Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

14 posts views Thread by paul downing via DotNetMonster.com | last post: by
1 post views Thread by DavidM | last post: by
4 posts views Thread by Chris | last post: by
1 post views Thread by Groove | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.