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

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
Public
Sub Page_Load(ByVal sender As Object, ByVal e As
EventArgs)
MyBase
.SampleText.Text = "Hello there"
End
Sub
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-2021 ASPAlliance.com  |  Page Processed at 2021-03-02 8:21:38 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search