NameCtrl Control issues in a Modal Dialog

J

Jason

Hi,

I have built a Web page that displays Messenger Presence using the
Name.NameCtrl Control. It works great in a regular browser (IE6 or IE7) but
when the page is opened in a Modal Dialog the Javascript executes with no
error, the object is created but the property "PresenceEnabled" returns a
false regardless of the Messenger Status.

I'm assuming this is a security issue but I'm hoping that there is a work
around as this is an internal company application where the functionality is
important.

Sorry if this is the wrong forum but I'm hoping someone can help??

Thanks
Jason
 
J

Jialiang Ge [MSFT]

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.
 
J

Jason

Jialiang Ge,

yes, that's my problem. I used to use iframes in Modal Dialog boxes to allow
postbacks in a modal dialog but since AJAX became avaialble I did not need to
do that any longer...I would appreciate you finding out why presence does not
work directly in a modal dialog as I think the iframe solution is a little
messy, workable but not optimal.. :)

Thanks again for responding
Jason
 
J

Jialiang Ge [MSFT]

Hello Jason,

This a quick note to let you know that I am still performing research on
this issue and waiting for the product team's response. But due to the
complexity of the problem, I have not found the reason yet. I am tring to
dertermine if it is an issue of IE modal dialog or of NameCtrl, so that we
could narrow the focus. Thank you for your patience, and I will get back to
you as soon as possible.

Regards,
Jialiang Ge ([email protected], remove 'online.')
Microsoft Online Community Support

=================================================
When responding to posts, please "Reply to Group" via your newsreader
so that others may learn and benefit from your issue.
=================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
V

vapor

Most likely wrong group, try the ASP.NET newsgroup.

--
--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The O.W.C. Black Book, 2nd Edition
Exclusively on www.lulu.com/owc $19.99
 
J

Jialiang Ge [MSFT]

Hello Jason,

Sorry for my delayed response. Would you send an email to me so that we can
communicate with this issue more efficiently? You may email me at:
(e-mail address removed) (remove 'online.').

Thanks
Regards,
Jialiang Ge ([email protected], remove 'online.')
Microsoft Online Community Support

=================================================
When responding to posts, please "Reply to Group" via your newsreader
so that others may learn and benefit from your issue.
=================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top