Go Back   Velocity Reviews > Newsgroups > ASP Net
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

ASP Net - DHtml, Images and a DataGrid

 
Thread Tools Search this Thread
Old 08-12-2005, 03:21 PM   #1
Default DHtml, Images and a DataGrid


Please, please, please help!!!

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';
}




=?Utf-8?B?VGltOjouLg==?=
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot download ultrasound images... sdpatches14 General Help Related Topics 0 09-14-2009 10:16 PM
Crytal Reports and Visual Studio 2005 Images not displaying peterc Software 2 01-21-2009 07:00 AM
Blur Images Display DKS General Help Related Topics 0 06-03-2008 04:14 PM
How to keep images on DVD from being copied WVAngel Software 0 11-18-2006 03:39 AM
images look wider in dvd antispam1@golfvalleyhomes.com DVD Video 0 10-09-2005 06:43 PM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46