ASP.NET中怎样将页面设为首页,加入收藏
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中怎样将页面设为首页,加入收藏的更多相关文章
- ASP.Net中后台控制页面提示信息的显示方式
ASP.Net中后台控制页面提示信息的显示方式 用于删除或修改成功后的显示:(背景No空白) ScriptManager.RegisterStartupScript(this, typeof(Pa ...
- 请解释ASP. NET中的web页面与隐藏类之间的关系
请解释ASP.NET中的web页面与其隐藏类之间的关系 其实页面与其隐藏类之间就是一个部分类的关系,你在页面上放一个一个的控件就是在这个类中定义一个一个的属性, 因为是同一个类的部分类的关系,所以隐藏 ...
- 设为首页 和 收藏本站js代码 兼容IE,chrome,ff
设为首页 和 收藏本站js代码 兼容IE,chrome,ff //设为首页 function SetHome(obj,url){ try{ obj.style.behavior='url(#defau ...
- 设为首页/加入收藏JS代码
传统网站常用的设为首页/加入收藏js代码 <a href="javascript:void(0)" onclick="sethome(this,window.loc ...
- ASP.NET—015:ASP.NET中无刷新页面实现
原文作者:杨友山 原文地址:http://blog.csdn.net/yysyangyangyangshan/article/details/39679823 前面也说过在asp.net中前后前交互的 ...
- ASP.NET中的加密页面机制
本节介绍ASP.NET对视图信息的加密功能.Page.RegisterRequiresViewStateEncryption方法就是将控件注册为需要视图状态加密的控件.如果您要开发用于处理潜在的敏感信 ...
- javascript 设为首页 | 加入收藏夹 JS代码
我们介绍一个可兼容所有浏览器的加入收藏代码代码,大概原理是这样的我们根据获取用户navigator.userAgent.toLowerCase()信息来判断浏览器,根据浏览器是否支持加入收藏js命令, ...
- HTML设为首页/加入收藏代码
(特别注意:要把'这个符号换成无任何输入法状态中输入的'这个符号,否则程序无法运行) 1.文字型: <a onclick="this.style.behavior='url ...
- JS代码实现网站设为首页加入收藏功能
<script language="javascript"> //加入收藏 function AddFavorite(sURL, sTitle) { try { win ...
随机推荐
- Byte数据类型—Java
字节与字符 一个英文字母(不分大小写)占一个字节的空间,一个中文汉字占两个字节,一个二进制数字序列,在计算机中作为一个数字单元,一般为8位二进制数,换算为十进制最小值为0,最大值为255. UTF-8 ...
- Struts2拦截指定方法的拦截器
作者:禅楼望月 默认情况下,我们为一个Action配置一个拦截器,该拦截器会拦截该Action中的所有方法,但是有时候我们只想拦截指定的方法.为此,需要使用struts2拦截器的方法过滤特性. 要使用 ...
- 论 Web 前端加密的意义
论 Web 前端加密的意义 Web前端密码加密是否有意义? https://www.zhihu.com/question/25539382 https://blog.csdn.net/hla19910 ...
- Dubbo 的 Helloworld
前提条件 安装好了 ZooKeeper 作为注册中心 服务端 <?xml version="1.0" encoding="UTF-8"?> < ...
- [HDU6304][数学] Chiaki Sequence Revisited-杭电多校2018第一场G
[HDU6304][数学] Chiaki Sequence Revisited -杭电多校2018第一场G 题目描述 现在抛给你一个数列\(A\) \[ a_n=\begin{cases}1 & ...
- kafka卡顿
一次kafka卡顿事故排查过程 https://www.cnblogs.com/yougewe/p/8975550.html 由于一次功能上线后,导致某数据量急剧下滑,给我们紧张的呢!排查过程也是个学 ...
- 【bzoj2124】等差子序列 STL-bitset
题目描述 给一个1到N的排列{Ai},询问是否存在1<=p1<p2<p3<p4<p5<…<pLen<=N (Len>=3),使得Ap1,Ap2,A ...
- [Leetcode] text justification 文本对齐
Given an array of words and a length L, format the text such that each line has exactly L characters ...
- 雪碧图background-position的rem用法
background的雪碧图配合rem就正常写即可,要加上background-size,大小为sprites的原图尺寸,宽高为一帧的尺寸.例如: .player{ width: 2.32rem; / ...
- CentOs7 minimal安装后没有ifconfig命令解决方法
没有ifconfig命令目前我了解两个原因: 1./sbin/ifconfig 可以执行,但是ifconfig无法执行.这个解决的时候只需要将/sbin 添加到PATH下就可以了. 2.系统未安装if ...