Sunday, May 27, 2012

Create a jump list in window7


Create a jump list in window7 with Internet Explorer9


Jump list is an important feature of window7. Here I explain how it is creating by some JavaScript code and internet explorer9.


First open any of Visual Studio versions and create an ASP.Net project. And write simple list tag of html in body section.

<ul>
    <li value="http://dkbakrecha.webs.com" style="color:Olive; text-decoration:underline; list-style-type:square; cursor:pointer;">DKB Planet</li>
    <li value="http://dkbakrecha.blogspot.in" style="color:Olive; text-decoration:underline; list-style-type:square; cursor:pointer;">DKB Blog</li>
</ul>

And then create a “Meta” tag named “msapplication-task” and content attribute of that like this.

<title>DKB Jumplist</title>
    <meta name="msapplication-task" content ="name=DKB Planet; action-uri=http://dkbakrecha.webs.com/;icon-uri=Images/alarm.ico" />
    <meta name="msapplication-task" content ="name=DKB Blog; action-uri=http://dkbakrecha.blogspot.in/;icon-uri=Images/application.ico" />   


When you run your project (F5) then the project is seen like that:



Drag your site and drop on it to taskbar. Like:

Drag:

            Drop:


After right click on your icon then your jump list look like:




Making code for recent item for Jump List

For giving recent functionality to your jump list write JavaScript code in head tag of site.

<script type="text/javascript">
   
    function AddItemToJumpList(selectedItem,selectedItemUrl,iconName)
    {
        try
        {
            if(window.external.msIsSiteMode())
                {
                window.external.msSiteModeCreateJumpList('Recent visited');
                //Add Item
                window.external.msSiteModeAddJumpListItem(selectedItem, selectedItemUrl, iconName);
                window.external.msSiteModeShowJumpList();
                }
        }
        catch (e)
        {
        alert('Feature not support. Error: =' + e.Message);
        }
    }
    </script>

And embed onClick event to <li> tag:

onclick="AddItemToJumpList('DKB Planet','http://dkbakrecha.webs.com','Images/alarm.ico')"
Build your application, again drag and drop your site to taskbar. It is seen like that:


Finally your jump list is ready to use. It is easy to manage your useful link to it and view your frequently using of your suffering.

Enjoy :-)

Dharmendra Bakrecha

No comments:

Nathuram Godse - The Man Who Killed Gandhi

Nathuram Godse - The Man Who Killed Gandhi (The Other Side of The Story)