教學:動態改變網頁title !
1.把網頁的title tag改成Runat Server!
*********************************
<title id="webtitle" runat=server></title>
*********************************
2.宣告HTML控制項!
VB
*********************************
Protected WithEvents webtitle As HtmlGenericControl
'OR
Protected WithEvents webtitle As HtmlContainerControl
*********************************
C#
*********************************
protected HtmlGenericControl webtitle;
//OR
protected HtmlContainerControl webtitle;
*********************************
3.在PAGE_LOAD中設定TITLE名稱!
VB
*********************************
Me.webtitle.InnerHtml = "XXX討論區"
*********************************
C#
*********************************
this.webtitle.InnerHtml="XXX討論區";
*********************************
*********************************
<title id="webtitle" runat=server></title>
*********************************
2.宣告HTML控制項!
VB
*********************************
Protected WithEvents webtitle As HtmlGenericControl
'OR
Protected WithEvents webtitle As HtmlContainerControl
*********************************
C#
*********************************
protected HtmlGenericControl webtitle;
//OR
protected HtmlContainerControl webtitle;
*********************************
3.在PAGE_LOAD中設定TITLE名稱!
VB
*********************************
Me.webtitle.InnerHtml = "XXX討論區"
*********************************
C#
*********************************
this.webtitle.InnerHtml="XXX討論區";
*********************************
0 Comments:
張貼留言
<< Home