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 October 8th, 2004, 02:48 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 245
Thanks: 0
Thanked 0 Times in 0 Posts
Default <%@ Page Language="vb" Explicit="True" > Ques

Hello
I took some code from an example and implemented it but I not sure why it works.

The sample code has <%@ Page Language="vb" Explicit="True" Debug="True" %> and no Inherits or Codebehind attributes.

When I added the appropriate Inherits & Codebehind attribute it doesn't run. But when I leave it as <%@ Page Language="vb" Explicit="True" Debug="True" %> it works.

Why does this work????????

Is it because the sample code has been compiled already and doesn't need Inherits & Codebehind?

I thought these two were required for the ASPX page to run???

 
Old October 8th, 2004, 05:27 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

The two aren't required; remember that ASP.NET doesn't require a code-behind page; Visual Studio .NET just happens to use that compilation model.
 
Old October 15th, 2004, 12:59 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

As Brian stated, the "CodeBehind" attribute of the directive is essentially meaningless to ASP.NET. It's strictly a helper for Visual Studio.

The "Inherits" attribute however is significant. When ASP.NET parses the .aspx file, it dynamically compiles a new class for that page: "mypage_aspx". By default, that class is inherited from System.Web.UI.Page. The inherits statement tells the compiler to inherit from the codebehind class. So if you tried to inherit from a class that doesn't exist, you'll get an error. As long as this class exists in an assembly that is "searchable" (i.e. it's in the local application /bin or the framework location or the global assembly cache) than the page should run.





Similar Threads
Thread Thread Starter Forum Replies Last Post
<%@control Language="VB"%> cp75 ASP.NET 1.0 and 1.1 Basics 2 October 17th, 2006 02:00 PM
<style> tags in a <body> vs. <div> bcat BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 1 March 27th, 2005 08:50 AM
HELP: XSL -> HTML <select selected=true> jedbartlett XSLT 4 October 7th, 2004 11:16 PM
<marquee><b>About CHAT App. in PHP4</b></marquee> Ramkrishna PHP How-To 1 September 11th, 2004 07:01 AM
a problem in book<<beginning asp.net using vb>> luoware ASP.NET 1.0 and 1.1 Basics 3 December 8th, 2003 09:32 PM





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