[RESOLVED] messenger dynamic buttons
Hi,
I have an asp.net website with sql server db.
I have a table of customers, and a grid showing all the customers. I'd like to add an msn messenger button for each customer, so that clicking on this button will open up msn messenger and call this customer according to the field "messengerID" on my customers table.
in addition, if possible I'd like that a certain message (based on the user details) will be automatically sent to the customer inside messenger when it opens up.
I'd appreciate your help on this, also if it is not possible to do in msn messenger please advise what other communication service I can use to allow chat + voice talk between the user and the customer.
thanks,
Re: messenger dynamic buttons
You'll need to generate dynamic hyperlinks that call a javascript method onclick. A commonly available code snippet for this is:
Code:
<object classid="clsid:B69003B3-C55E-4B48-836C-BC5946FC3B28" codeType="application/x-oleobject" id="IMessenger">
</object>
<a href='javascript:IMessenger.InstantMessage("[email protected]");window.location.replace(window.location)'><b>Send MSN Message</b></a>
I don't think you can actually get the message sent though unless there's some undocumented API in there. This code snippet requires MSN to be installed.
Re: messenger dynamic buttons
thanks for that, I'll give it a try.
do you have any idea how to use skype instead of msn messenger in the same way?
thanks,
Re: messenger dynamic buttons
Never seen any code for launching skype. If you've seen it on any websites, you should be able to get the relevant code from there.
Re: messenger dynamic buttons
there's a detailed info in skype website on how to create buttons for specific users ("static" buttons). but nothing about making bounded to db records.
thanks,
Re: messenger dynamic buttons
Show me. It may be possible to modify it to work with information coming from a database.
Re: messenger dynamic buttons
Re: messenger dynamic buttons
Code:
<!--
Skype 'Skype Me™!' button
http://www.skype.com/go/skypebuttons
-->
<script type="text/javascript" src="http://download.skype.com/share/skypebuttons/js/skypeCheck.js"></script>
<a href="skype:abcdefg?call"><img src="http://download.skype.com/share/skypebuttons/buttons/call_green_white_92x82.png" style="border: none;" width="92" height="82" alt="Skype Me™!" /></a>
Very simple. All you need is a hyperlink, and you set its NavigateUrl property from the codebehind. Since it's from the codebehind, you get the value from a database.
The rest of the code there is rather static and you can simply stick it on the page. Just replace the <a> element with a server side hyperlink control.
Re: messenger dynamic buttons
great!
any ideas how to send an initial message when clicking the skype button?
Re: messenger dynamic buttons
I think it's pretty limited, this is as far as they've exposed.
Re: messenger dynamic buttons
thanks again, I wonder if its possible at all on skype, or on any other messenger...
I can't add to your rating (I must spread some before)
thanks,
Re: messenger dynamic buttons
Most probably not. While getting a chat window open may be alright, impersonating a user may breach some privacy laws.
Re: messenger dynamic buttons
Re: messenger dynamic buttons
So... all questions answered? If so, add resolved. I think this could be useful for future searchers.
Re: [RESOLVED] messenger dynamic buttons
I was hoping someone could find a fix for sending an initial message, but I guess its not possible.
thanks,
Re: [RESOLVED] messenger dynamic buttons
There is another route you can investigate. Though it's not exactly the best solution.
You may have seen certain web based messengers.
Using certain web based APIs, you could actually get the user to login by giving his credentials, and then it may be possible for you to send a 'system' or even an impersonated message. I don't know how far you can go with that API, but it's an avenue you could explore.
Re: [RESOLVED] messenger dynamic buttons
yes, but that would require the other side to stay listening on this messenger, which doesn't fit to this project requirments.
Re: [RESOLVED] messenger dynamic buttons
Those are all the options you have then. :)
If you ever find a solution to go beyond this, do post it.