Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: Visual Studio Question


Message #1 by "Arbon Reimer" <arbon@l...> on Mon, 11 Mar 2002 17:49:20 -0700
I'm sorry for asking a newbie question... but I am puzzled why Visual Studio

does this.



I use the CodeBehind [filename].aspx.vb a lot and love how that works.  But

when I save the [filename].aspx.vb file the top tag on the page always

changes:



Example:

<%@ Page Language="vb" Inherits="Payroll.[classname]"

CodeBehind="[filename].aspx.vb" Src="[filename].aspx.vb" %>



I always have to delete the word "Payroll" to make the page work... and

every time I save the [filename].aspx.vb page that word is rewritten.  Is

there a way I can fix this so it doesn't do it anymore or how can I write my

code such that I don't have to change it?  My application is called Payroll

and the class name is what is written on the .aspx.vb page initially...

seems to work out OK in basically every situation.



Thanks everyone for your input!  I'm confused.



Arbon Reimer

Golden, Colorado



Message #2 by "John Wormald" <johnswormald@h...> on Wed, 13 Mar 2002 18:34:00
Arbon



If you have "built" your application including the web form you are having 

problems with, you must remove the src attribute from the Page directive. 

VS.NET is prefixing your Inherits class with the root namespace as defined 

in your project properties. Because the src attibute is referencing your 

codebehind which make no reference to your root name space, a compilation 

error will be thrown at runtime. To enable the class defined in the .dll 

to be used (which does reference the root namespace), remove the src 

attribute. Now you don't have to keep removing the the root namespace 

prefix from the Inherits attribute every time you amend the form.



Hope this helps



John

















> I'm sorry for asking a newbie question... but I am puzzled why Visual 

Studio

> does this.

> 

> I use the CodeBehind [filename].aspx.vb a lot and love how that works.  

But

> when I save the [filename].aspx.vb file the top tag on the page always

> changes:

> 

> Example:

> <%@ Page Language="vb" Inherits="Payroll.[classname]"

> CodeBehind="[filename].aspx.vb" Src="[filename].aspx.vb" %>

> 

> I always have to delete the word "Payroll" to make the page work... and

> every time I save the [filename].aspx.vb page that word is rewritten.  Is

> there a way I can fix this so it doesn't do it anymore or how can I 

write my

> code such that I don't have to change it?  My application is called 

Payroll

> and the class name is what is written on the .aspx.vb page initially...

> seems to work out OK in basically every situation.

> 

> Thanks everyone for your input!  I'm confused.

> 

> Arbon Reimer

> Golden, Colorado

> 


  Return to Index