A question about VS.NET

I

Ing. Rajesh Kumar

Hello Everybody
I just started to use VS.NET. I came to know that it only allows to use code behind. I normally use one *.aspx file but does not matter. I can start using Code Behind, but what I do not like is that VS.NET automatically create *.VB code behind files to use with compilation, so either I have to run the Build command to make assemblies or I have to manualy change the page Directive in *.aspx files and have to manualy add Namespace and Import statements in the *.vb files.

Example :

VS creates this :
In *.ASPX
<%@ Page Language="vb" Codebehind="WebForm1.aspx.vb" Inherits="WebApplication1.WebForm1"%>

In *.VB
Public Class WebForm1
Inherits System.Web.UI.Page

And I want this to avoid creating assemblies :
In *.ASPX
<%@ Page Language="vb" SRC="WebForm1.aspx.vb" Inherits="MyNameSpace.WebForm1"%>

In *.VB
Imports System
Imports System.Web.UI.WebControls
Namespace MyNameSpace
Public Class WebForm1
Inherits System.Web.UI.Page

Is it possible to tell VS.NET in a decent way, please do what I want ?

By the way, when I open my existing *.aspx (HTML and VB in one file) in VS.NET, the code is not colored and no Intelli sense is there. I have lot's of these files. How can I use intelli sense with these files or do i have to write them in VS.NET from scratch ?
Thanks
Raja
 
H

Hans Kesting

On the project level, you can set a "default namespace" property. It seems
this is still the default "WebApplication1".

Hans Kesting



Hello Everybody
I just started to use VS.NET. I came to know that it only allows to use code
behind. I normally use one *.aspx file but does not matter. I can start
using Code Behind, but what I do not like is that VS.NET automatically
create *.VB code behind files to use with compilation, so either I have to
run the Build command to make assemblies or I have to manualy change the
page Directive in *.aspx files and have to manualy add Namespace and Import
statements in the *.vb files.

Example :

VS creates this :
In *.ASPX
<%@ Page Language="vb" Codebehind="WebForm1.aspx.vb"
Inherits="WebApplication1.WebForm1"%>

In *.VB
Public Class WebForm1
Inherits System.Web.UI.Page

And I want this to avoid creating assemblies :
In *.ASPX
<%@ Page Language="vb" SRC="WebForm1.aspx.vb"
Inherits="MyNameSpace.WebForm1"%>

In *.VB
Imports System
Imports System.Web.UI.WebControls
Namespace MyNameSpace
Public Class WebForm1
Inherits System.Web.UI.Page

Is it possible to tell VS.NET in a decent way, please do what I want ?

By the way, when I open my existing *.aspx (HTML and VB in one file) in
VS.NET, the code is not colored and no Intelli sense is there. I have lot's
of these files. How can I use intelli sense with these files or do i have to
write them in VS.NET from scratch ?
Thanks
Raja
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top