Image Thumbnails (Web User Control)

PROKA

Junior Contributor
Joined
Sep 3, 2003
Messages
249
Location
Bucharest
Ok so I created a web user control to display a thumbnail Image ( picture 1 - control.jpg )

I dynamically generate controls of this kind and put them into a panel, in another control.

The problem is that they appear in a column - like mode, not as it should ( picture 2 - panel.jpg )
The panel is 700px width

I tried to delete the last character in the webuser control, below that table, but it won't let me :((

Any ideeas ?
 
Last edited:
The problem is that a panel translates to a div tag which by nature is a block element (i.e. it will go to a new line). If you add the style attribute to the panel (display) and give it the value (in-line) you should be fine. This will have it display as shown in the code for view source:

<div style="display: inline">

Alternatively you might want to try a differant control...like a table, or span element and have it run on the server.
 
I tried Panel.Style.Add("display", "inline") and still it doesn't work :( i'm kinda desperate

I even took out the panel and put Me.Controls.Add(...) and it's the same :(
 
Last edited:
I think if we saw the code it might shed some light on things. Something is causing it to wrap, it may be something outside of the panel...a CSS style or something like that. The addition of the style should of took care of the wrapping, it may be .NET is over-writing it, never done it before to be honest...things like that I've used a table or repeater for.
 
If you change the HTML for your user control to something like

Code:
<%@ Control Language="vb" AutoEventWireup="false" Codebehind="View_Image.ascx.vb" Inherits="Panel.View_Image" TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
<div style="width: 160px; height: 200px; float: left; border: 1px solid #999;">
	<p style="text-align: center;">
		<asp:label id="lblItem" runat="server" ForeColor="#9BA8A2" Font-Size="9px" Font-Names="Verdana">Item 748</asp:label><BR>
		<BR>
		<asp:Image id="Image1" runat="server" ImageUrl="image.jpg"></asp:Image><BR>
		<BR>
		<asp:ImageButton id="ImageButton3" runat="server" ImageUrl="file:///C:\Inetpub\wwwroot\ConnexImageLibrary\Images\icoTVC.jpg"></asp:ImageButton> 
		<asp:ImageButton id="ImageButton2" runat="server" ImageUrl="file:///C:\Inetpub\wwwroot\ConnexImageLibrary\Images\icoPrintAds.jpg"></asp:ImageButton> 
		<asp:ImageButton id="ImageButton1" runat="server" ImageUrl="file:///C:\Inetpub\wwwroot\ConnexImageLibrary\Images\icoImages.jpg"></asp:ImageButton>
	</p>
</div>

That should do what you want

Regards

Andy
 
Back
Top