0
我有這樣的代碼C#和添加動態META標籤
protected void Page_Load(object sender, EventArgs e)
{
DataSet.DestinationsDataTable GetDestinations = (DataSet.DestinationsDataTable)dta.GetData();
Page.Title = GetDestinations.Rows[0]["Meta_Title"].ToString();
HtmlMeta hm = new HtmlMeta();
HtmlHead head = (HtmlHead)Page.Header;
hm.Name = GetDestinations.Rows[0]["Meta_Desc"].ToString();
hm.Content = GetDestinations.Rows[0]["Meta_Key"].ToString();
head.Controls.Add(hm);
}
而且它返回此錯誤(在內容網頁上)
The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
的思考?
啊,謝謝,我知道這個問題我只是不知道如何解決它。再次感謝! – balexander 2010-04-30 02:47:05