How to add a particular website in Favorites menu?

Ddd
Posted by Ddd under ASP.NET category on | Points: 40 | Views : 1886
Suppose we want to add dotnetfunda.com in the Favorites menu in the browser

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<input id="Button1" type="button" value="add to favorite" onclick="demo()" />
</div>
</form>
</body>
</html>
<script type="text/javascript">
function demo() {
window.external.AddFavorite("http://www.dotnetfunda.com", "dotnetfunda");

}
</script>

Note:
When we the button is clicked, an inputbox will open containing both the arguments specified in its 2 textboxes.

Just click the Add button of the inputbox.

Comments or Responses

Posted by: T.saravanan on: 1/21/2011 Level:Silver | Status: [Member] [MVP] | Points: 10
Hi Dinesh.K,

Nice Code.My suggestion just post your code using code tag.

Login to post response