Hello Jason,
From your post, my understanding on this issue is: you wonder why the
ActiveX control NameCtrl always returns PresenceEnabled as false in a modal
dialog box, and how to work-around it. If I'm off base, please feel free to
let me know.
According to the MSDN article
http://msdn2.microsoft.com/en-us/library/ms455335.aspx, this property
(PresenceEnabled) is false if the control is used on a page that is not on
the intranet or on a trusted site, or if a supported version of an instant
messaging program such as MSN Windows Live Messenger is not running. But
when I tried to add my test site into trusted list and made sure that the
Window Live Messenger was running, the control still cannot work properly
in a modal dialog. I am consulting the Product team members for the reason,
and will get back to you as soon as possible.
A possible workaround is to use an IFrame in the showModalDialog's target
page, and set the src of the IFrame as the real page that calls NameCtrl. I
have tested it and it worked well in my side:
Home Page:
<script language="javascript">
function fnOpen(){
window.showModalDialog("B.HTML", "", "")
}
</script>
<body>
<form id="form1" runat="server">
<div>
<input type=button onclick="fnOpen()" value="test" />
</div>
</form>
</body>
Modal Dialog page: (B.html)
<body>
<iframe
src ="C.html"
width="100%" height="100%">
</iframe>
</body>
The page containing NameCtrl: (C.Html)
<script language="JavaScript">
InitializeObject();
function InitializeObject()
{
NameObj = new ActiveXObject("Name.NameCtrl");
alert(NameObj.PresenceEnabled);
}
function ShowOOUI(name)
{
var obj = window.event.srcElement;
NameObj.ShowOOUI(name,0,0,0);
}
function HideOOUI()
{
NameObj.HideOOUI();
}
</script>
<body>
<span onmouseover="ShowOOUI('*******@hotmail.com')"
onmouseout="HideOOUI()">*********</span>
</body>
Please have a try and let me know if it works for you.
Sincerely,
Jialiang Ge (
[email protected], remove 'online.')
Microsoft Online Community Support
==================================================
For MSDN subscribers whose posts are left unanswered, please check this
document:
http://blogs.msdn.com/msdnts/pages/postingAlias.aspx
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications. If you are using Outlook Express/Windows Mail, please make sure
you clear the check box "Tools/Options/Read: Get 300 headers at a time" to
see your reply promptly.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.