1

I am displaying in a repeater a image and a textbox but the problem is that i am trying to make it look like in the image to the right so the image is to eft and text to the right of the image i am trying to make it working user but then only the image if fine on a new line but the label is wierd that the problem. this is my code please take a look and se what i have done wrong and maybe help me to solve my problem. Here is the code snippet!

if (vData.SkillNameOther != null && vData.SkillLevel == "Beginner")
{
    lbl.Text = vData.SkillNameOther+ "<br />"; 
    img.ImageUrl = @"~/_layouts/images/Cv.Knowit/pie-1-4.png";

    RepeaterDataBase.Controls.Add(lbl);
    RepeaterDataBase.Controls.Add(img);
}

enter image description here

EJC
  • 2,062
  • 5
  • 21
  • 33
krisal
  • 621
  • 6
  • 19

1 Answers1

1

First, you are adding the controls in the wrong order, the label should be added 2nd.

Even so, the label would still align bottom. Then you need to vertical align:

Vertically align text next to an image?

Another option would be to use a table (see post below) and vertical align the cells:

How to create a three column table in ASP.Net Repeater

Community
  • 1
  • 1
LouD
  • 3,776
  • 4
  • 19
  • 17