hit counter html code
April 2008 - Posts - Yizhe Online Tablet

April 2008 - Posts

Met up with Alvin(ASp.net MVP) and Steve (Sharepoint MVP) in the convention center this morning before proceeding for lunch and keynote session by Sean O'Driscoll . For the first time, there will be open-space sessions in the summit where attendee can participate in discussions hosted by follow MVPs.

Later today, there will be the welcome receiption/dinner where we get to meet up with other MVPs from the same region and also have a good dinner with Lilian, our MVP Lead. More pictures will be posted later in the day.

Posted by shenyizhe | with no comments

Posting the blog from the boarding gate (D41) to Hong Kong at 11AM Singapore Time. I'll be doing a transit in Hong Kong to San Francisco and hopefully reach San Francisco on time at 1:50PM (SFO Time)

 

Good luck to the DreamSpark team tomorrow and it's amazing they are able to pull it off in such a short period of time.  What's DreamSpark and what it has to do with Singapore? Check back on Thursday (Singapore) to know more!

 

Posted by shenyizhe | with no comments

Aspiring singer out there who loves singing can now have their own complete song without having to know how to play an instrument!

http://research.microsoft.com/~dan/mysong/

image

Posted by shenyizhe | 5 comment(s)

We have another MIX-It-Up event coming up here in Singapore.

Wednesday, 9 April 2008 6:30 p.m. - Wednesday, 9 April 2008 8:30 p.m. Singapore

Agenda:

• Keynote: Overview of Microsoft Tools for Web
• Mix 01: Visual Studio 2008: The Swiss Army Knife for Web Development
• Inspiration to Innovation: Asiasoft Online Pte Ltd
• Mix 02: XAML: Enabling Designer and Developer collaboration

Register here.  And as always feel free to send feedback directly to me.

Posted by shenyizhe | with no comments

(This article is written by Jolene and Qianting who are both student attachee in the Microsoft Innovation Center-Student Attachment Program)

To integrate the Windows Live Contacts control in your website is easy. There are references available on the Windows Live Developers website to guide you in creating the control. It uses Javascript that enables user to use the contact control with the web site.

 

To get started, you have to include the following JavaScript source into the source page of index.aspx page:

<script type="text/javascript" src="http://controls.services.live.com/scripts/base/v0.3/live.js"></script>

<script type="text/javascript" src="http://controls.services.live.com/scripts/base/v0.3/controls.js"></script>

 

You can include the codes below the <title> tag of the page.

 

Next step is to declare the xml namespace. You can make changes in the html tag as follows:

<html xmlns=http://www.w3.org/1999/xhtml xmlns:devlive="http://dev.live.com">

 

You have to add the JavaScript for the event handlers that you will use later in between the <head> tag:

<script type="text/javascript">

function signin()

{

};

function signout()

{

};

function showerror(p_msg)

{

}

function setAttributes()

{

var s = document.location.href;

s = s.substr(0,s.length - document.location.hash.length) +

"#" +

encode(elMessage.value);

document.location.replace(s);

document.location.reload();

}

function resize()

{

elContactsElement.style.width = "200px";

elContactsElement.style.height = "300px";

}

function hescq(p_str)

{

return p_str.replace(/&/g,"&amp;").replace(/</g, "&lt;").replace(/>/g,"&gt;").replace(/\"/g,"&quot;").replace(/\'/g,"&apos;");

}

function encode(str)

{

if ("string" != typeof str) str = "";

str = encodeURIComponent(str);

return str.replace(/%/g, "\\"); // hide '%' from browser (Firefox)

}

function decode(str)

{

if ("string" != typeof str) str = "";

str = str.replace(/\\/g, "%"); // translate '\\' back to '%'

return decodeURIComponent(str);

}

</script>

Add the css code also between the <head> tag:

<style type="text/css">

body {

color:black;

background-color:white;

font-family:Verdana;

font-size:12px;

}

#ContactsControl {

border:solid 1px black;

float:right;

}

#message

{

height: 74px;

width: 330px;

}

</style>

 

 

Add a new HTML page in your project and name it as channel.htm:

clip_image002

 

Paste the following code in the source page of channel.htm:

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<title>Channel</title>

<meta name="ROBOTS" content="NONE"/>

<script type="text/javascript">

function doc_loaded()

{

try

{

var hash = window.location.hash.substr(1);

if (window.location.replace == null)

window.location.replace = window.location.assign;

// IE6 reports a security warning if iframe.src = "" or "about:blank" on an https page

window.location.replace("about:blank");

var name = hash.split("/")[0];

var win = null;

if (name)

win = window.parent.frames[name];

else

win = window.parent.parent;

win.Microsoft.Live.Channels.Mux._recv_chunk(hash);

}

catch (ex)

{

/* ignore */

}

}

</script>

</head>

<body onload="doc_loaded()"></body>

</html>

The next step to do is to add the contactscontrol in the <body> tag. You can place it below the <iframe> tag.

<devlive:contactscontrol

id="ContactsControl"

devlive:channelEndpointURL="channel.htm"

devlive:view="tile"

devlive:market="en"

devlive:onSignin="{ signin(); }"

devlive:onSignout="{ signout(); }"

devlive:onError="showerror"

></devlive:contactscontrol>

Modify the <body> tag into the following:

<body onload='resize();'>

The resize() method will resize the height and width of the contacts control.

Add the following JavaScript below the contacts control:

<script type="text/javascript">

var elContactsElement = document.getElementById('ContactsControl');

var elMessage = document.getElementById('message');

var elWidth = "200";

var elHeight = "300";

var elMarket = "en";

var elView = "tile";

if (document.location.hash.length > 1) {

var args = document.location.hash.substr(1).split('&');

if (args.length == 1) {

elMessage.value = hescq(decode(args[0]));

}

}

else

{

elWidth.value = "200";

elHeight.value = "300";

}

elContactsElement.setAttribute("message", elMessage.value);

elContactsElement.setAttribute("devlive:market", "en");

elContactsElement.setAttribute("devlive:view", "tile");

</script>

Add the following table just on the top of the end </body> tag:

<table style="display:inline">

<tr>

<td>

<strong>Message:</strong>

</td>

<td>

<textarea id="message" cols="20" name="S1" rows="1"> Hi friends, I have something really cool to share. Check it out at http://www.innovativesingapore.com ! :)</textarea>

</td>

</tr>

<tr>

<td colspan="2">

<input onclick="{ setAttributes(); }" type="button" value="Set Message" align="right" /></div>

</td>

</tr>

</table>

 

This table contains the message to be sent when you initiate conversation with people in your contact list. You can change the message to be sent in the textbox by clicking the ‘Set Message’ button.

 

You will get the following after you sign in to the website:

clip_image004

 

Feel free to rearrange the position of the controls to suit your preference.

The default message will be shown in the messenger chatbox when u click the msn icon( clip_image006 ):

clip_image007

 

One thing that you have to take note is that you have to sign in to Windows Live Messenger in order to initiate conversation with them in the windows contacts control. You can choose an alternative way to email your contact by clicking the email icon (clip_image008 ).

Congratulations! You have now sucessfully integrate the 3 Live Services Windows Live ID, Windows Live Alerts and Windows Contacts Control into one project. Feel free to explore other Live Services here.

Posted by shenyizhe | 1 comment(s)