Preferred Language:
Listing 29.32 - MovieView.cs
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;
namespace myControls
{
[DefaultProperty("Title")]
public class MovieView : WebControl
{
private string _title = "Movie Title";
private string _description = "Movie Description";
[Category("Movie")]
[Description("Movie Title")]
public string Title
{
get { return _title; }
set { _title = value; }
}
[Category("Movie")]
[Description("Movie Description")]
public string Description
{
get { return _description; }
set { _description = value; }
}
protected override void RenderContents(HtmlTextWriter writer)
{
writer.RenderBeginTag(HtmlTextWriterTag.H1);
writer.Write(_title);
writer.RenderEndTag();
writer.Write(_description);
}
protected override HtmlTextWriterTag TagKey
{
get
{
return HtmlTextWriterTag.Div;
}
}
}
}
ASP.NET 3.5 Unleashed
- Containing almost 2,000 pages of code samples and in-depth explanation of the
ASP.NET 3.5 Framework, ASP.NET 3.5 Unleashed is the most comprehensive book
written on the ASP.NET 3.5 Framework.
ASP.NET 3.5 Unleashed is now available in your local bookstore and online (Published January 7, 2008).
All of the code samples from this book are hosted "live" at this website.
Click here
to view the table of contents and code samples.