PROKA Posted July 3, 2005 Posted July 3, 2005 (edited) 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 ? Edited March 13, 2007 by PROKA Quote Development & Research Department @ Elven Soft
bri189a Posted July 3, 2005 Posted July 3, 2005 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. Quote
PROKA Posted July 3, 2005 Author Posted July 3, 2005 (edited) 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 :( Edited July 3, 2005 by PROKA Quote Development & Research Department @ Elven Soft
bri189a Posted July 3, 2005 Posted July 3, 2005 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. Quote
PROKA Posted July 4, 2005 Author Posted July 4, 2005 (edited) See my attachment for the code Edited March 13, 2007 by PROKA Quote Development & Research Department @ Elven Soft
a_jam_sandwich Posted July 4, 2005 Posted July 4, 2005 If you change the HTML for your user control to something like <%@ 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 Quote Code today gone tomorrow!
PROKA Posted July 4, 2005 Author Posted July 4, 2005 thank you Andy, I owe you a six pack. is Stella Artois ok ? Quote Development & Research Department @ Elven Soft
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.