<title id="mytitle" runat="server"></title>
....class BB:string m_s;
public string Title 
{
   get {return m_s;}
   set {
        m_s = value;
        Control c = Page.FindControl("mytitle");
        if (c != null && c is HtmlGenericControl)
              ((HtmlGenericControl)c).InnerText = m_s;
        //or
        /*
              LiteralControl lc = new LiteralControl("<Title>" + m_s +"</Title>");
              Page.Controls.Add(0,lc);
        */ 
       }}

解决方案 »

  1.   

    public DataSet MY_DATASET
    {
    get
    {
    currentPage = (Request.QueryString["Page"] == null) ? 1 : Convert.ToInt32(Request.QueryString["Page"]);
    if (!this.IsPostBack)
    {
    Conn.ConnClass dbconn=new Conn.ConnClass();
    myCount=dbconn.GetCountByTable(queryTable);
    SqlDataAdapter da=dbconn.GetDa(queryStr);
    if (myCount % itemPerPage == 0)
    {
    totalPages = myCount / itemPerPage;
    }
    else
    {
    totalPages = (int) myCount / itemPerPage + 1;
    }
    da.Fill(myDataset,itemPerPage*(currentPage-1),itemPerPage,"table");
    }
    return myDataset;
    }
    }
      

  2.   

    可是编译出错:
    Literal content ('TestABC') is not allowed within a 'System.String'.
    -----------
    [ParseChildren(true)]
    属性Title应该对应一个LiteralControl,title的类型是sring可以么,不用是ITemplate?
      

  3.   

    the simplest solution is<A:BB RunAt="server" Title="TestABC"></A:BB>