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="data:images/dot.gif" width=12 border=0> <a href=# onClick="window.external.addFavorite(‘http://www……/’,'****’);return(false)">收藏本站</a>

将其中"www……"换成你的网页地址 
"****"换成你的网站名字

ASP.NET中怎样将页面设为首页,加入收藏的更多相关文章

  1. ASP.Net中后台控制页面提示信息的显示方式

    ASP.Net中后台控制页面提示信息的显示方式   用于删除或修改成功后的显示:(背景No空白) ScriptManager.RegisterStartupScript(this, typeof(Pa ...

  2. 请解释ASP. NET中的web页面与隐藏类之间的关系

    请解释ASP.NET中的web页面与其隐藏类之间的关系 其实页面与其隐藏类之间就是一个部分类的关系,你在页面上放一个一个的控件就是在这个类中定义一个一个的属性, 因为是同一个类的部分类的关系,所以隐藏 ...

  3. 设为首页 和 收藏本站js代码 兼容IE,chrome,ff

    设为首页 和 收藏本站js代码 兼容IE,chrome,ff //设为首页 function SetHome(obj,url){ try{ obj.style.behavior='url(#defau ...

  4. 设为首页/加入收藏JS代码

    传统网站常用的设为首页/加入收藏js代码 <a href="javascript:void(0)" onclick="sethome(this,window.loc ...

  5. ASP.NET—015:ASP.NET中无刷新页面实现

    原文作者:杨友山 原文地址:http://blog.csdn.net/yysyangyangyangshan/article/details/39679823 前面也说过在asp.net中前后前交互的 ...

  6. ASP.NET中的加密页面机制

    本节介绍ASP.NET对视图信息的加密功能.Page.RegisterRequiresViewStateEncryption方法就是将控件注册为需要视图状态加密的控件.如果您要开发用于处理潜在的敏感信 ...

  7. javascript 设为首页 | 加入收藏夹 JS代码

    我们介绍一个可兼容所有浏览器的加入收藏代码代码,大概原理是这样的我们根据获取用户navigator.userAgent.toLowerCase()信息来判断浏览器,根据浏览器是否支持加入收藏js命令, ...

  8. HTML设为首页/加入收藏代码

    (特别注意:要把'这个符号换成无任何输入法状态中输入的'这个符号,否则程序无法运行)   1.文字型:     <a onclick="this.style.behavior='url ...

  9. JS代码实现网站设为首页加入收藏功能

    <script language="javascript"> //加入收藏 function AddFavorite(sURL, sTitle) { try { win ...

随机推荐

  1. chrome & dark theme

    chrome & dark theme Dark Reader Extensions https://darkreader.org/help/en/ https://chrome.google ...

  2. css 3 filter

    css 3 filter image & PS effect https://api-platform.com#COMPANIES

  3. Hibernate常用方法之_插入

    1.使用session的save方法进行插入 public void saveUser(User user){ Session session = null; Transaction transact ...

  4. 条件查询Criteria

    public User getUserByNameCri(String name){ Session session = null; User user = null; try { session = ...

  5. System l类arraycopy的用法

    package org.springframework; /** * @author 秦林森 */ public class Test { public static void main(String ...

  6. Ecplise下设置jQuery和ExtJs自动提示

    Spket 1.6.23下载: http://yunpan.cn/cjJYmEcMFIuuN  访问密码 5642 ext jsb下载:http://yunpan.cn/cjJYR7ZTzibQn  ...

  7. AQS同步组件及ReentrantLock和synchronized的区别

    AQS同步组件 CountDownLatch(只有一个线程对他进行操作): 主线程必须在启动其它线程后立即调用await()方法.这样主线程的操作就会在这个方法上阻塞,直到其它线程完成各自的任务. S ...

  8. 如何根据pom.xml文件下载jar包

    遇到过这种情况:从网上下载了一个项目, 使用的maven, 但是我想要新建一个项目, 但是不需要使用maven. 但是我怎么样才能将他那个项目的所有引用的jar包给下载下载下来呢; 1.下载一个mav ...

  9. 转:js中javascript:void(0) 真正含义

    from:http://www.jb51.net/article/71532.htm 在Javascript中void是一个操作符,该操作符指定要计算一个表达式但是不返回值. 我想使用过ajax的都常 ...

  10. android 调试 native 程序的方法

    一.背景 首先说需求,这个需求非常常见,就是android上需要的一个功能,linux已经有开源代码而且非常稳定,希望能直接porting过去使用,这个程序是pure c 的代码,也就是说,跟andr ...