Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

why is .Net IDE changing my "Inherits" field??

Status
Not open for further replies.

phbrady

Programmer
Oct 17, 2003
41
US
OK,

I have a solution named "Quiz", residing in a folder called "Quiz". In my aspx pages, the Inherits directive reads "Inherits=Quiz", and my codebehind page contains the "Quiz" class. When I make changes to the codebehind page, the IDE changes the line to read "Inherits=Quiz.Quiz", and that causes a parser error! Every time I change my codebehind page, I have to remove the first "Quiz" reference from the Inherits line for my code to run. Why is this happening??
-----------
<%@ Page Language=&quot;vb&quot; AutoEventWireup=&quot;false&quot; Codebehind=&quot;Quiz.aspx.vb&quot; Inherits=&quot;Quiz&quot; Src=&quot;Quiz.aspx.vb&quot;%>
-----------

Thanks!
Paul
 
&quot;Inherits=Quiz.Quiz&quot;

is saying
Namespace: Quiz
Class: Quiz

The Namespace comes from what you originally named to project. If your codebehind file looks like this
Code:
Namespace Quiz
    Class Quiz Inherits System.Web.UI.Page
    End Class
End Namespace
then your aspx page will need to use &quot;Inherits=Quiz.Quiz&quot;.

Whenever you change the classname or namepsace of the class defined in the codebehind file, VS updates the Page directive so that it inherits from the correct class.

HTH
 
Well

That's perfectly logical except that my codebehind file does not have the namespace statement. When I added the namespace statement, then the IDE automatically changed the aspx file inherits statement to read &quot;Inherits=Quiz.Quiz.Quiz&quot; !!

???
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top