File: HelloWorld.cs
using System;
public class PropertyHelloWorld
{
private string _message;
public string Message
{
get
{
return _message;
}
set
{
if (value.Length > 5)
throw new Exception("Message too long!");
_message = value;
}
}
public string SayMessage()
{
return _message;
}
}
File: Default.aspx
<%@ Page Language="C#" %>
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
Show Property Hello World