CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > visual_studio.visual_studio_2005 Tags:
Item Type: NewsGroup Date Entered: 1/1/2006 7:33:07 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 3 Views: 31 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
4 Items, 1 Pages 1 |< << Go >> >|
aspfun
Asp.Net User
Why code behind form become <%@ Import Namespace="System.Data" %>?1/1/2006 7:33:07 PM

0/0

I created a form in VS 2005 in code behide form mode but look like bellow:

<%@ Page Language="VB" %>

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

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

<%@ Import Namespace="System.Configuration" %>

Why added <% @ ...%>? How to get rid of them?

ScottGu
Asp.Net User
Re: Why code behind form become <%@ Import Namespace="System.Data" %>?1/1/2006 9:12:03 PM

0/0

Hi aspfun,

When you create new pages using VS 2005 or Visual Web Developer there is a checkbox option on the "Add New Item" dialog box that allows you to choose "Place Code in Separate File".  If you check this box, it will make it a code-behind page -- in which case the import statements will be added to the code-behind class.

The above page is a non-code-behind page where the code is defined inline with <script runat=server> blocks.  With this scenario, import statements are done using the <%@ Import %> page directive.

Hope this helps,

Scott

aspfun
Asp.Net User
Re: Why code behind form become <%@ Import Namespace="System.Data" %>?1/1/2006 9:30:19 PM

0/0

Thank you Scott, it help.

But this only for new form. How to set up "Code behind form" as default feature when new web site create?

ScottGu
Asp.Net User
Re: Why code behind form become <%@ Import Namespace="System.Data" %>?1/1/2006 10:37:46 PM

0/0

Hi ASPFun,

I believe Visual Web Developer will remember the last setting you used when creating pages, and use that as the default when new pages are created or when new sites are created.  So if you build a code-behind page, then it should set that as the default going forward.

Hope this helps,

Scott

4 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Sams Teach Yourself ASP.NET in 21 Days Authors: Chris Payne, Pages: 1104, Published: 2002
ASP.NET: Tips, Tutorials, and Code Authors: Scott Mitchell, Pages: 878, Published: 2002
ASP.NET Professional Projects: Professional Projects Authors: Hersh Bhasin, Pages: 638, Published: 2002
Professional VB 2005 Authors: Bill Evjen, Billy Hollis, Rockford Lhotka, Tim McCarthy, Rama Ramachandran, Kent Sharkey, Bill Sheldon, Pages: 1066, Published: 2006
Professional ASP.NET 2.0 Authors: Bill Evjen, Scott Hanselman, Farhan Muhammad, Srinivasa Sivakumar, Devin Rader, Pages: 1253, Published: 2005
Microsoft Jscript.Net Programming Authors: Justin Rogers, Pages: 360, Published: 2001
Debugging ASP.NET Authors: Jonathan Goodyear, Brian Peek, Brad Fox, Pages: 376, Published: 2001
Migrating to .NET: A Pragmatic Path to Visual Basic .NET, Visual C++ .NET and ASP .NET Authors: Dhananjay Katre, Prashant Halari, Narayana Rao Surapaneni, Manu Gupta, Meghana Deshpande, Pages: 487, Published: 2002
Beginning ASP.NET 1.1 with Visual C# .NET 2003 Authors: Chris Ullman, John Kauffman, Chris Hart, Dave Sussman, Daniel Maharry, Pages: 888, Published: 2004
Magic of ASP.Net with C# Authors: Panikkar Shibi, Pages: 750, Published: 2005

Web:
Code Behind in Web Forms and User Controls In Listing 1.4 you created the code behind class for the user control. As with the Web Form code behind class, you import all the necessary namespaces. ...
Separating Code from Content in ASP.net Pages via Code-Behind ... The code behind file is in fact the base class from which the web form inherits. ... <%@ import Namespace="System.Data" %>




Search This Site:










generating a new machinedecryptionkey and machinevalidationkey

backporting a module to an older version..

sql server connection pooling and windows authentication

shared menu across portals

page.ispostback == false and datagrid

go to reference or definition between projects

hack - desktopmodules table

asp --> asp.net

c# question

how to get a new browser window?

setting up users under windows authentication mode

trying to send email getting error could not access 'cdo.message'

text box values are not being considered?

new free skin available

dll reference

how to debug an vb.net com component from vb 6.0

filtering site-map nodes based on security roles

unable to install migration asssitant tool

how to create a printable page

how to use active directory to modify web application designed under .net1.1 with form-based authentication

thoughts on getting away from so many aspx files....

club site starter kit problems

gemini dnn integration

differences between linkbutton and button with postbackurl

compiling asp .net code

wizard and inserting into database

help in username and password

authorisation manager (azman) problems

text and layout sizing in dnn 3.1.1

why must i set selectedindex to -1 ?

 
All Times Are GMT