ASP.NET中怎樣將頁面設為首頁,加入收藏

來源:互聯網
上載者:User

標籤:

1、文字js指令碼事件:<span onClick="var strHref=window.location.href;this.style.behavior=’url(#default#homepage)’;this.setHomePage(‘http://www.unvs.cn’);" style="CURSOR: hand">

2、文字連結事件:<a href="#" onClick="window.external.addFavorite(‘http://blog.unvs.cn’,‘Unvs部落格’)"title=Unvs部落格’ >

<input type=button value=匯入收藏夾 onclick=window.external.ImportExportFavorites(true,"http://www.unvs.cn/");> 
<input type=button value=匯出收藏夾 onclick=window.external.ImportExportFavorites(false,"http://www.unvs.cn/");> 
<input type=button value=整理收藏夾 onclick="window.external.ShowBrowserUI(‘OrganizeFavorites’, null)"> 
<input type=button value=查看源檔案 onclick="window.location = ‘view-source:’+ window.location.href"> 
<input type=button value=語言設定 onclick="window.external.ShowBrowserUI(‘LanguageDialog’, null)"> 
<input type=button value=加入收藏夾 onclick="window.external.AddFavorite(‘http://www.fsing.net/’, ‘風信子網路’)"> 
<input type=button value=加入到頻道 onclick="window.external.addChannel(‘http://www.fsing.net/’)"> 
<input type=button value=設成首頁 onclick="this.style.behavior=’url(#default#homepage)’;this.setHomePage(‘http://www..****..com/’)">

3、給一個網站上設定"設為首頁"和"加入收藏夾"的代碼應該怎麼寫?(在一個小圖片上面加)
<A href="#" onmouseover="window.external.addFavorite(‘http://www.****.com/’,‘e時區特色論壇’)" target="_self" >收藏本頁</A> 
<a href="#" onmouseover="this.style.behavior=’url(#default#homepage)’;this.setHomePage(‘http://www.****.com/’);" target="_self">設為首頁</a>

4、用javascript來實現,寫在控制項的onclick中
網上查的javascript例子(onclick中是具體的實現)<table align="center">
<tr>
    <td onclick="window.location.href;this.style.behavior=’url(#default#homepage)’;this.setHomePage(‘http://blog.unvs.cn/‘);" style="CURSOR:Hand"><font color=black>設為首頁  </font></td>
    <td onclick="window.external.AddFavorite(location.href,document.title);" style="CURSOR:Hand"><font color=black>加入收藏</font></td>
</tr>
</table>
設為首頁 
<A href=# onclick="this.style.behavior=’url(#default#homepage)’;this.setHomePage(‘http://www.baidu.com’);">圖片</A> 
—————————————– 
加如收藏 
<A href="javascript:window.external.AddFavorite(‘http://www.baidu.com’,‘百度’)">圖片</A>

加入收藏 
<a href="javascript:window.external.AddFavorite(‘http://www.baidu.com’,‘百度’)">加入收藏</a> 
首頁 
<span onclick="var strHref=window.location.href;this.style.behavior=’url(#default#homepage)’;this.setHomePage(‘http://www.baidu.com’);" style="CURSOR: hand"><br>設為首頁</br></span>

<a href=# onClick="this.style.behavior=’url(#default#homepage)’;this.setHomePage 
(‘http://www……/’);">設為首頁</a> <IMG height=11 
src="images/dot.gif" width=12 border=0> <a href=# onClick="window.external.addFavorite(‘http://www……/’,‘****’);return(false)">收藏本站</a>

將其中"www……"換成你的網頁地址 
"****"換成你的網站名字

ASP.NET中怎樣將頁面設為首頁,加入收藏

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.