asp.net中的自定义控件问题,在线焦急等待中.........
用户自定义控件类
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
/// <summary>
/// SubHeader 用户自定义控件
/// </summary>
namespace FriendsReunion
{
public class SubHeader : WebControl
{
//The URL to navigate to if the user is not registered
private string _register = String.Empty;
public string RegisterUrl
{
get { return _register; }
set { _register = value; }
}
public SubHeader()
{
//
// TODO: 在此处添加构造函数逻辑
//
//Initailize the default values
this.Width = new Unit(100, UnitType.Percentage);
this.CssClass = "SubHeader ";
}
//This method is called when the control is being built
protected override void CreateChildControls()
{
//Clear any previously loaded controls
this.Controls.Clear();
Label lbl;
//If the user is authenticated,we will render their name
if (Context.User.Identity.IsAuthenticated)
{
lbl = new Labe