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. 不使用库函数、自己编写的(strlen、strcpy、strcmp、strcat、memcmp、memcpy、memmove)

    不使用库函数.自己编写的(strlen.strcpy.strcmp.strcat.memcmp.memcpy.memmove) //求字符串长度的函数 int my_strlen(const char ...

  2. 如何让旧浏览器支持HTML5新标签

    HTML5出现也不短了,很多网站的页面都进行了改版,为了降低代码量(不需要起太多的类名),提升加载速度,提高标签的语义性,因此,在网页中大量使用了section,article,header等HTML ...

  3. Sublime Text 2创建可复用的代码片段

    对于前端工程师来讲,写一个html页面的基本结构是体力活,每次去拷贝一个也麻烦,sublime text 2 提供了一个很好的复用代码片段.下面介绍一下创建一个html5的代码片段的过程.在菜单上点击 ...

  4. TCP/IP Note4

    TCP/IP邮件 你的电子邮件程序会使用不同的TCP/IP协议: 使用SMTP来发送邮件: 使用POP从邮件服务器下载邮件: 使用IMAP连接到邮件服务器 1. SMTP - 简单邮件传输协议 SMT ...

  5. codevs 1078 最小生成树 kruskal

    题目描述 Description 农民约翰被选为他们镇的镇长!他其中一个竞选承诺就是在镇上建立起互联网,并连接到所有的农场.当然,他需要你的帮助. 约翰已经给他的农场安排了一条高速的网络线路,他想把这 ...

  6. idea 导入spring 源码注意的问题

    问题:idea导入spring 源码的步骤是: 首先从官网下载spring的源码:git clone https://github.com/spring-projects/spring-framewo ...

  7. angular js 模拟获取后台的数据

    在这里我们把后台的数据用一个.json文件进行代替. 项目的目录结构如下: puDongLibraryLearning----ui-router-learning ---- data-------pe ...

  8. SpringMVC学习 -- 使用 POJO 对象绑定请求参数值

    Spring MVC 会按请求参数名和 POJO 属性名进行自动匹配 , 自动为该对象填充属性值 , 支持级联属性.如:address.province. package com.itdoc.spri ...

  9. [06] JavaScript 类型

    下面对知识点总结: 1.类型分类 a.原始类型:number, string, boolean, null, undefined b.对象类型:除了原始类型都是(例如:object,array, fu ...

  10. JavaScript中Array(数组)的属性和方法(转)

    数组有四种定义的方式 使用构造函数:var a = new Array();var b = new Array(8);var c = new Array("first", &quo ...