473,402 Members | 2,050 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

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';
}
Nov 19 '05 #1
0 1037

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: sundew | last post by:
Here I am presenting you the new Wednus proj. subtree, Wednus DHTML RPG engine, or just 'Wednus RPG' with a demo game using the engine. About the engine itself, since this DHTML game engine...
13
by: moondaddy | last post by:
Happy Holidays All! I want to load a datagrid with images and text (Image, text, image, text, etc...). The data for this datagrid will be coming from sql server and the images are stored as files...
9
by: tshad | last post by:
Is there a way to use your own image in place of the automatic one that ASP uses when doing editing in your DataGrid pages? We already have a style of button we are using and would like to be...
3
by: Joe Turek | last post by:
I store images in a database instead of the filesystem. I deliver these images via a page that uses Response.OutputStream to send the bytes back to a calling page. So a given page on my site will...
0
by: Tim::.. | last post by:
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...
76
by: rcoco | last post by:
Hi all, I'm facing this problem I have images on my website but when I Deploye the website on server the Images are not there I only get the X sign. How can I go about this. Thanks
10
by: cjparis | last post by:
Hello everyone. If anyone can give me a hand I would be gratefull Am doing a site which requires a moving element and have used DHTML to do it. Have a simple Browser detect script to sort IE...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.