Taylohtio/GeneralApi/GeneralApi.MOSS/CondoInfoWebPart/CondoInfoWebPart.cs

41 lines
1.1 KiB
C#

using System;
using System.ComponentModel;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
namespace Taloyhtio.GeneralApi.MOSS
{
public class CondoInfoWebPart : WebPart
{
private bool error;
protected override void CreateChildControls()
{
if (!this.error)
{
try
{
base.CreateChildControls();
this.Controls.Add(this.Page.LoadControl("~/_ControlTemplates/15/Taloyhtio/Integration/CondoInfo.ascx"));
}
catch (Exception x)
{
this.handleException(x);
}
}
}
private void handleException(Exception x)
{
this.error = true;
this.Controls.Clear();
this.Controls.Add(new LiteralControl(string.Format("<span style=\"color: Red\">{0}</span>", x.Message)));
}
}
}