473,781 Members | 2,729 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataGrid and Image Database

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" AutoGenerateCol umns="False"
ShowFooter="Tru e" OnPageIndexChan ged="DataGrid1_ Paged"
Width="70%" CellPadding="4" BorderWidth="1p x" BorderStyle="Ri dge"
BorderColor="Li ghtGray"
CssClass="txtAr ea" GridLines="Hori zontal"
HeaderStyle-HorizontalAlign ="Center" HeaderStyle-Font-Bold="True"
AlternatingItem Style-BackColor="Whit eSmoke" AllowPaging="Tr ue"
PagerStyle-Mode="NextPrev"
AllowSorting="T rue">
<AlternatingIte mStyle BackColor="Whit eSmoke"></AlternatingItem Style>
<ItemStyle HorizontalAlign ="Center"></ItemStyle>
<HeaderStyle Font-Bold="True" HorizontalAlign ="Center"></HeaderStyle>
<Columns>
<asp:TemplateCo lumn HeaderText="" ItemStyle-HorizontalAlign ="Center">
<ItemTemplate >
<img ID='I<%# DataBinder.Eval (Container, "ItemIndex" )%>'
src="../images/user.gif" style="cursor: hand"
onmouseover="ja vascript:showTo pic(<%# DataBinder.Eval (Container,
"ItemIndex")%>) ;" onmouseout="jav ascript:hideIma ge(<%#
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:TemplateCol umn>
<asp:BoundColum n HeaderText="Nam e" DataFormatStrin g="{0}"
DataField="Name "></asp:BoundColumn >
<asp:BoundColum n HeaderText="Dep t." DataFormatStrin g="{0}"
DataField="Dept ."></asp:BoundColumn >
<asp:BoundColum n HeaderText="Ext ." DataFormatStrin g="{0}"
DataField="Ext" ></asp:BoundColumn >
<asp:HyperLinkC olumn HeaderText="Ema il" Text="<img
src='../images/envelope.gif' border='0'>" DataNavigateUrl Field="Email"
DataNavigateUrl FormatString="m ailto:{0}"></asp:HyperLinkCo lumn>
</Columns>
</asp:datagrid>

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

var image = document.getEle mentById('d' + num);
image.style.dis play = 'inline';

lastSelectedNum = num;
}

function hideImage(num)
{
// hide image layer
var image = document.getEle mentById('d' + num);
image.style.dis play = 'none';
}

Nov 19 '05 #1
0 1242

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

Similar topics

1
2264
by: Jim Hammond | last post by:
The code below implements two datagrid columns that display images. The first column is just a test that always displays the same image directly from a file. The second column pulls the image from the dataset. The datagrid contains several additional columns that are not seen here because they are automatically generated and bound to the dataset. All columns work except the second image column, which attempts to bind to the dataset. When...
2
1830
by: SQL_Klovn | last post by:
Hi! I have been struggeling for quite some time now with a stupid problem which drives me crazy. I have Datagrid, where I load some images from a SQL2000 database. This works fine, but I am not abel to make the image in the datagrid to be a link to another page. I have created a Templeate Column for this. Could someone be kind enough to point me in the right direction?
1
2218
by: ltt19 | last post by:
Hi everyone! I want to do da Image gallery using just the datagrid, this one will dilpays only images, no text, that means that it will have about 4 Collumns that will displays just images from the same database table, from the same collumn of the table. However I could not reproduce this, since each Row (with 4 collumns) displays 4 times the same image. How can i fix it? here is a part of the code:
2
2858
by: Tim::.. | last post by:
Hi I'm trying to create a little application that shows an image of a user when you mouseover there details in a datagrid. The datagrid is populated from an Active Directory Database and I presume the best way to create the popup is by using a layer with javascript hide and show... I intend to use a database to store the pictures in and the use the users full name to build a relationship between the database with the images and the...
0
919
by: Tim::.. | last post by:
Little brain teaser for anyone... I'm creating a contacts datagrid that is populated by a Active Directory but I want to have a popup image of each contact when you mouseover there name... I have got that far! What I can't work out how to do is to match up the Active Directory record with the correct image that is stored in an SQL database! I have been trying to use a function but not really getting any where... (see below)
0
1056
by: Tim::.. | last post by:
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...
13
2672
by: Lyners | last post by:
I have a web page writen in ASP.NET that contains some javascript so that when a user presses a button, or edits a certain field in a datagrid, another cell in the datagrid is filled with a value. My probelm.... when I have the user press the update button (which does a post back that loops through the datagrid and updates a database) the field/cell that is filled by the javascript appears to be blank in my update code, even though I can...
8
3897
by: Matt | last post by:
Guys I could really use some help with this. I think that it's probably a simple solution but I haven't been able to find anything. I have a datagrid on my form that I populate via code like this... Me.My_DataGrid.Rows.Add(Column1, Column2, Column3) Well now I have a datagrid that I want to populate with an image. So for example...
1
2695
by: rascalking | last post by:
Hello, So I've read many forums that explained how to get an image out of SQL Server database and display it. I used an alternate .aspx page to retrieve the image and write it back as binary which everyone on many sites said to do. The problem is its not working. My exact situation is that I am creating News Articles based on news entries which are either text or pictures. I want to display a picture in the datagrid if there is one....
0
9639
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9474
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8964
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7486
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6729
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5375
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5507
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3633
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2870
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.