Web Controls - • Derived from System.Web.UI.Control • Create your own tags and tag prefixes Custom Controls • Creation(Hello.cs using System

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
Chapter 6 Web Controls Detailed description of server controls provided by FCL.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Chapter 7 User Controls Yingcai Xiao
Background image of page 2
Custom controls built from HTML and server-side scripts. Create your own tags and tag prefixes. File.ASCX User Controls
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Creation (Hello.ascx) <h1>Hello, world</h1> Usage (UserControlDemo.aspx) <%@ Register TagPrefix="Xiao" TagName="Hello" src="Hello.ascx" %> <html> <body> <form RunAt="server"> <Xiao:Hello RunAt="server" /> </form> </body> </html> TagPrefix="Xiao" defines a new tag prefix. TagName="Hello" defines a new tag using src="Hello.ascx". User Controls
Background image of page 4
Chapter 8 Custom Controls Yingcai Xiao
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Custom Controls Custom-built server controls using only a server-side language (no HTML).
Background image of page 6
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 8
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: • Derived from System.Web.UI.Control. • Create your own tags and tag prefixes. Custom Controls • Creation (Hello.cs) using System; using System.Web.UI; namespace WP { public class Hello : Control { protected override void Render (HtmlTextWriter writer) { writer.Write ("Hello, world"); } } } Note: the Render method is required to be overridden . • Compilation: csc /target:/library Hello.cs Move Hello.dll to “bin” of the virtual directory. • Usage CustomControlDemo.aspx <%@ Register TagPrefix="win" Namespace="WP" Assembly="Hello" %> <html> <body> <form RunAt="server"> <win:Hello RunAt="server" /> </form> </body> </html> Custom Controls...
View Full Document

This note was uploaded on 04/09/2008 for the course CS 408 taught by Professor Xiao during the Spring '08 term at The University of Akron.

Page1 / 8

Web Controls - • Derived from System.Web.UI.Control • Create your own tags and tag prefixes Custom Controls • Creation(Hello.cs using System

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online