PC Review


Reply
Thread Tools Rate Thread

DHTML / ASP.NET Guru... Help

 
 
=?Utf-8?B?VGltOjouLg==?=
Guest
Posts: n/a
 
      15th Aug 2005
I have a datagrid that displays a list of contacts on our intranet site
using the ActiveDirectory as it's main Data Source.

I want to be able to show an image of each employee using a popup layer but
am not sure how I match the Active Directory Data to the correct image stored
in an SQL database. I plan on using the users fullname or email address as an
identifier to match up the image with the correct user but really don't know
how to make sure the correct image is loaded into the layer when you mouse
over a certain employee...

I have created the DataGrid and the popup layer that all have individual
<div> id's but how do I load the image in from the database into the correct
layer...

I would really, really appritiate some help on this on!

Thanks


<<<<CODE>>>>

<asp:datagrid id="DataGrid1" runat="server" AutoGenerateColumns="False"
ShowFooter="True" OnPageIndexChanged="DataGrid1_Paged"
Width="70%" CellPadding="4" BorderWidth="1px" BorderStyle="Ridge"
BorderColor="LightGray"
CssClass="txtArea" GridLines="Horizontal"
HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="True"
AlternatingItemStyle-BackColor="WhiteSmoke" AllowPaging="True"
PagerStyle-Mode="NextPrev"
AllowSorting="True">
<AlternatingItemStyle BackColor="WhiteSmoke"></AlternatingItemStyle>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
<HeaderStyle Font-Bold="True" HorizontalAlign="Center"></HeaderStyle>
<Columns>
<asp:TemplateColumn HeaderText="" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<img ID='I<%# DataBinder.Eval(Container, "ItemIndex")%>'
src="../images/user.gif" style="cursor: hand"
onmouseover="javascript:showTopic(<%# DataBinder.Eval(Container,
"ItemIndex")%>);" onmouseout="javascript:hideImage(<%#
DataBinder.Eval(Container, "ItemIndex")%>);">
<DIV id='D<%# DataBinder.Eval(Container, "ItemIndex")%>' style="Z-INDEX: 1;
LEFT: 300px; POSITION: absolute; TOP: 100px; HEIGHT: 130px; WIDTH: 100px;
BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT:
black 1px solid; BORDER-BOTTOM: black 1px solid; BACKGROUND-COLOR: white;
display: none;">
<asp:Image Runat="server" ID="userImage"
ImageUrl="../images/NoImage.gif"></asp:Image></DIV>
</ItemTemplate>
</asp:TemplateColumn>
<asp:BoundColumn HeaderText="Name" DataFormatString="{0}"
DataField="Name"></asp:BoundColumn>
<asp:BoundColumn HeaderText="Dept." DataFormatString="{0}"
DataField="Dept."></asp:BoundColumn>
<asp:BoundColumn HeaderText="Ext." DataFormatString="{0}"
DataField="Ext"></asp:BoundColumn>
<asp:HyperLinkColumn HeaderText="Email" Text="<img
src='../images/envelope.gif' border='0'>" DataNavigateUrlField="Email"
DataNavigateUrlFormatString="mailto:{0}"></asp:HyperLinkColumn>
</Columns>
</asp:datagrid>

<<<JavaScript>>>
var lastSelectedNum = -1;
function showTopic(num)
{
if (lastSelectedNum >= 0)
{
// reset the last selected item
var lastimage = document.getElementById('d' + lastSelectedNum);
lastimage.style.display = 'none';
}

var image = document.getElementById('d' + num);
image.style.display = 'inline';

lastSelectedNum = num;
}

function hideImage(num)
{
// hide image layer
var image = document.getElementById('d' + num);
image.style.display = 'none';
}


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.NET/DHTML David Microsoft C# .NET 1 12th Dec 2005 09:44 PM
CMI - DHTML =?Utf-8?B?U2lsZW50Q29kZQ==?= Windows XP Embedded 4 17th May 2005 06:45 PM
dhtml jane wright Windows XP General 2 15th Jul 2004 08:01 AM
DHTML =?Utf-8?B?R3JhbnQgVHVycmktUGV0cmll?= Microsoft Frontpage 0 11th Apr 2004 10:11 PM
dhtml event handling using dhtml edit control possible? Abhijeet Shelke Microsoft Dot NET Framework 0 5th Nov 2003 07:14 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:58 AM.