![]() |
@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! |
Re: @Import Syntax and Importing Namespaces in global.asax file
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 |
| All times are GMT. The time now is 03:02 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.