title: Adding presence indicator to a custom web part
body: <p>I have a custom web part which is generating some user data.  I have added the appropriate code to output the standard presence icon and menu however this is acting rather stangely.</p>
  
  <p>The rendered html of my web part is as follows:</p>
  
  <pre><code>&lt;span&gt;  
     &lt;a href="http://mysite/Person.aspx?accountname=USERID"&gt;USERNAME&lt;/a&gt;&amp;nbsp;   
     &lt;img border="0" height="12" width="12" src="/_layouts/images/blank.gif" onload="IMNRC('USEREMAIL')" id="imnUSERID" ShowOfflinePawn="1" /&gt;  
  &lt;/span&gt; 
  </code></pre>
  
  <p>Obviously replacing USERID, USERNAME, USEREMAIL etc.</p>
  
  <p>The problems are twofold.  </p>
  
  <p>1) In IE7 the presence information does not get retrieved.  The menu displays correctly but the icon does not appear and when you hover over the gap the drop down menu does not provide IM settings.</p>
  
  <p>2) In IE8 RC1 the presence information comes back correctly and the icon displays, but the drop down list is rendered severeal inches above the icon. (<a href="http://twitpic.com/1z4r9" rel="nofollow noreferrer">see this screenshot</a>)</p>
  
  <p>Any help with these issues, or with other tips about adding presence to custom web parts would be greatfully received.</p>
  
  <h3>Update on progress</h3>
  
  <p><em>- Adding web page to 'Trusted Sites' for IE7 - did nothing
   - Compatability view for IE8 makes no difference.
   - Changed to id="CSRP_id,type=sip"
  Changed code to the following on recommendation:</em></p>
  
  <pre><code>&lt;span&gt;     
  &lt;img class="PresenceImage" src="/_layouts/images/imnhdr.gif" onload="IMNRC('USEREMAIL')" name="imnmark" ShowOfflinePawn="1" id="contact_im,type=sip" /&gt;     
  &lt;/span&gt;
  </code></pre>
  
  <p><em>None of the above updates have been succesful.</em></p>