To implement my example code first add a aspxa page into your project then under HTML head tag add the below javascript method to bookmark or add to favorites:
<script type="text/javascript">
function Add_Bookmark_Favorite(url, title)
{
if (window.sidebar)
{ // Mozilla Firefox Bookmark
//Make sure "Load this bookmark in the sidebar is deselected
window.sidebar.addPanel(title, url, "");
return false;
}
else if (window.external)
{ // IE Favorites
window.external.AddFavorite(url, title);
return false;
}
else if (window.opera && window.print)
{ // Opera Bookmark
return !addToFav(url, title)
}
}
script>
Now add the below link into your asp.net aspx page like below:
<a href="" title="" rel="sidebar" onclick="return Add_Bookmark_Favorite(location.href, document.title);">Bookmark / Add to Favoritesa>
Bookmark / Add to Favorites
Now run the page and click on the "Bookmark / Add to Favorites" link will popup a window to bookmark this page.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.