Page Templates
page 4 of 7
by . .
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 31144/ 67

Code-Behind Inheritance
Code-Behind Page Inheritance

Now what about code-behind pages? Well, they are basically exactly the same. See the sample below.

Public Class CodeBehind : Inherits HeaderTemplate
Sub Page_Load(ByVal sender As Object, ByVal e As
.SampleText.Text = "Hello there"
End Class

This is part of the same namespace that you created before. If you run it on an ASPX page like

<%@ Inherits="AGASPTemplates.CodeBehind" Src="TemplateCode.vb" %>

Live Demo

Now, if you look at the demo, you will see that there is a problem. The page still shows - "This is a page template sample" on it. This is because of the page execution order.

View Entire Article

User Comments

No comments posted yet.

Product Spotlight
Product Spotlight 

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2024  |  Page Processed at 2024-04-22 2:42:14 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search