Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (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 by PROKA
Development & Research Department @ Elven Soft
Posted

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.

Posted (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 by PROKA
Development & Research Department @ Elven Soft
Posted
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.
Posted

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

Code today gone tomorrow!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...