473,472 Members | 2,174 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How dynamically declare Image controls in a web form?

I want to display image information and images in a web form. The problem is
that I do not know how many images in a directory, but I have to display all
images in the directory into the web form. Before display images, I have a
static design of labels and textboxes for information (GridLayout). So there
is a position to consider as well. I have try to use Response.Write to set up
a table for this popurse, but the table is positioned at the first line
before anything else. Now I consider to use Image objects. But I have no idea
about it. Anyone could give me help? Thank you.

David
Jan 9 '06 #1
2 1260
This is really simple... you just need to create a server control to do
all the work for you. I do this A LOT. I never do anything myself; I
just have a huge library of assistants and controls to do whatever I
need. For the web, server controls area Godsend!

Instead of walking you through it though, just take a gander at the
below video. Using .NET 2.0/C#, you should be able to do this in no
time at all with little to no explantion (ergo, the beauty of .NET
2.0). Seriously... just take a stab at it. Your code will practically
fall together.

http://channel9.msdn.com/Showpost.aspx?postid=122122

As far as the flow...you want to use the proper XHTML elements. Things
in a list are basically collections and the XHTML collection element is
the ul and it's item is the li. Things in a dictionary basically map
to the dl where dt is the key and dd is the item. If you are doing a
simple image list, then you can use <ul><li><img src="" alt=""
/></li></ul>, but if you want an associated peice or set of information
(title or all image info) you may want to use
<dl><dt></dt><dd></dd></dl>. Using tables is absolutely out of the
question as they are deprecated for layouts (that is...learn CSS before
you even do anything with ASP.NET 2.0)

David Betz
http://www.davidbetz.net/winfx/
http://www.davidbetz.net/dynamicbliss/
http://www.getfirefox.com/

Jan 9 '06 #2
How about that I am using .NET 1.1?

David

"ag******@gmail.com" wrote:
This is really simple... you just need to create a server control to do
all the work for you. I do this A LOT. I never do anything myself; I
just have a huge library of assistants and controls to do whatever I
need. For the web, server controls area Godsend!

Instead of walking you through it though, just take a gander at the
below video. Using .NET 2.0/C#, you should be able to do this in no
time at all with little to no explantion (ergo, the beauty of .NET
2.0). Seriously... just take a stab at it. Your code will practically
fall together.

http://channel9.msdn.com/Showpost.aspx?postid=122122

As far as the flow...you want to use the proper XHTML elements. Things
in a list are basically collections and the XHTML collection element is
the ul and it's item is the li. Things in a dictionary basically map
to the dl where dt is the key and dd is the item. If you are doing a
simple image list, then you can use <ul><li><img src="" alt=""
/></li></ul>, but if you want an associated peice or set of information
(title or all image info) you may want to use
<dl><dt></dt><dd></dd></dl>. Using tables is absolutely out of the
question as they are deprecated for layouts (that is...learn CSS before
you even do anything with ASP.NET 2.0)

David Betz
http://www.davidbetz.net/winfx/
http://www.davidbetz.net/dynamicbliss/
http://www.getfirefox.com/

Jan 9 '06 #3

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

Similar topics

15
by: Geoff Cox | last post by:
Hello, Can I separately declare and initialize a string array? How and where would I do it in the code below? It was created using Visual C++ 2005 Express Beta 2 ... In C# I would have ...
8
by: Donald Xie | last post by:
Hi, I noticed an interesting effect when working with controls that are dynamically loaded. For instance, on a web form with a PlaceHolder control named ImageHolder, I dynamically add an image...
2
by: R Duke | last post by:
I have tried everything I can think of to change the visible property of a design time created control from a dynamically created control's command event handler. Here is the scenario. I have...
1
by: Josh | last post by:
Hi Guys, I have been having a big problem with trying to pass parameters into a user control when the user control is dynamically loaded into a placholder. I am developing in c#. I have get...
4
by: Chris Mahoney | last post by:
Hi Currently I am setting the background image of my page by using the following code: <style type="text/css"> BODY { BACKGROUND-IMAGE: url(myimage.jpg) } </style> What I would like to do...
2
by: Patrick | last post by:
I want to define a set of web-form templates in XML and render the equivalent web-form with ASP.NET, then process any input server controls on the form. Reading the XML file from Page_load is...
2
by: tshad | last post by:
Is there a way to dynamically add in User Controls where I would get the name from a session variable: If I have the following code:...
9
by: netasp | last post by:
hi all, how can I populate one aspx form when page is loading based on page ID? for example: loading page A (to search for VB code) would display labels and texboxes, dropdown lists all related...
3
by: Mark Denardo | last post by:
I'm trying to dynamically create and add controls to a web page: Label obj1 = new Label(); DropDownList obj2 = new DropDownList(); Controls.Add(obj1); Controls.Add(obj2); But I get the...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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
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,...
1
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...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.