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

A bit more...

A bit more

Take a look at the next piece of code.

Imports System
Imports
System.Web.UI
Imports
System.Web.UI.WebControls

Namespace
TemplatedDesign
Public
Class PageTemplate : Inherits
Page
Public
title As New
PlaceHolder()
Public
body As New
PlaceHolder()

Public
Sub Page_Init(ByVal sender As Object, ByVal e As
EventArgs)
QuickText("<html><head>")
Controls.Add(title)
QuickText("</head><body>")
Controls.Add(body)
QuickText("</body></html>")

End
Sub

Public Sub QuickText(ByVal text As String)
Controls.Add(
New LiteralControl(text))
End
Sub

End Class

Public Class CodeBehind : Inherits PageTemplate

Public
Sub Page_Load(ByVal sender As Object, ByVal e As
EventArgs)
MyBase
.title.Controls.Add(New
LiteralControl("<title>Template Test</title>"))
MyBase
.body.Controls.Add(LoadControl("samplecontrol.ascx"))
End
Sub

End Class

Public Class UserCodeBehind : Inherits UserControl

Public WithEvents Things As RadioButtonList
Public
WithEvents SelThing As
Label

Public Sub EventHappen(ByVal sender As Object, ByVal e As EventArgs)
SelThing.Text = "You selected : " & Things.SelectedItem.Text

End
Sub

End Class
End
Namespace

 

 


View Entire Article

User Comments

No comments posted yet.

Product Spotlight
Product Spotlight 





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


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-04-25 6:11:28 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search