using System.Web.UI.WebControls; using System.Web.UI; namespace omakomponent{ public class TervitusSilt2: WebControl{ protected override void RenderContents(HtmlTextWriter valja){ valja.WriteEncodedText("Tere, "+Tervitatav); } public virtual string Tervitatav{ get{ return (ViewState["tervitatav"]!=null)?(string)ViewState["tervitatav"]:"tundmatu"; } set{ ViewState["tervitatav"]=value; } } } }