Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.1
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 15th, 2004, 08:26 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 245
Thanks: 0
Thanked 0 Times in 0 Posts
Default Inherits="Projectname.Foldername.Webform."%> Ques

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="FolderName/Webform.aspx.vb" Inherits="Projectname.Foldername.Webform."%>


I put webform in a subfolder of root directory. How come I get error when I use the above code? There is a problem with Inherits, App doesn't know where to look for Webform.aspx.

What is wrong?



 
Old September 15th, 2004, 10:06 AM
Authorized User
 
Join Date: Sep 2004
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi

Inherits="projname.newfoldername.WebForm1"
u have to use . not /...

so iguess that was the problem

good luck

 
Old September 15th, 2004, 10:11 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 245
Thanks: 0
Thanked 0 Times in 0 Posts
Default

pran
I did use . not /:
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="FolderName/Webform.aspx.vb" Inherits="Projectname.Foldername.Webform."%>

 
Old September 15th, 2004, 10:20 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

When you inherit, you are not inheriting a file, but a class. You could have the following:

myproject/folder/folder/folder/folder/folder/folder/myclass.cs

with the class looking like this:

Public Class MyClass
End Class

When you want to inherit from this, the class name is still only "MyClass" regardless of where the physical code file lives. Therefore, you would still only inherit like this:

Public MyNewClass
   Inherits MyClass (or MyProject.MyClass)
End Class

This applies to web pages as well. Your webform codebehind class is "WebForm" so the web page needs to inherit from that name only:

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="FolderName/Webform.aspx.vb" Inherits="Projectname.Webform"%>

Specific paths matter when you are trying to reference a page or other resource in your web application, such as in a hyperlink or image.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Inherits sub class Brettvan1 VB.NET 2002/2003 Basics 4 June 10th, 2005 05:16 PM
Inherits the page? frej ASP.NET 1.0 and 1.1 Basics 3 June 3rd, 2005 09:26 AM
<Serializable> vs. Inherits ISerializable planoie General .NET 13 May 29th, 2005 10:06 AM
Inherits error phbrady General .NET 1 April 7th, 2004 02:15 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.