Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding Verticle Image And Label
Message
From
25/02/2010 16:47:20
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
 
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01451036
Message ID:
01451075
Views:
20
If you are going to progamatically add controls to a page I have found it easier to put a placeholder on the page where you can add the control to it. That way you can position the placeholder in the asp and use CSS to get everything layed out the way you want it.
Tim

>I have a long verticle image i want to display across the top of my page. I want to also have the page's caption displayed as a label centered over the image. The lable seems to be behind the image.
>
>
>protected void Page_Load(object sender, EventArgs e)
>{
>    if (!IsPostBack)
>    {
>        tblHeader = new Table();
>        tblHeader.Visible = true;
>        tblHeader.ID = "tblHeader";
>        tblHeader.Attributes.Add("width", "100%");
>
>        TableRow Row0 = new TableRow();
>        tblHeader.Rows.Add(Row0);
>
>        System.Web.UI.WebControls.Image imgHeader = new System.Web.UI.WebControls.Image();
>        imgHeader.ImageUrl = "Images/page_header.gif";
>
>        TableCell Cell0 = new TableCell();
>        Cell0.Controls.Add(imgHeader);
>        Cell0.ColumnSpan = 0;
>        Cell0.Width = 400;
>
>        Label lblCaption = new Label();
>        lblCaption.Text = "Apex Management Reports";
>        lblCaption.Font.Bold = true;
>        lblCaption.Font.Name = "Arial";
>        lblCaption.Font.Size = 14;
>        lblCaption.ForeColor = Color.Red;
>
>        TableCell Cell1 = new TableCell();
>        Cell1.Controls.Add(lblCaption);
>
>        Row0.Cells.Add(Cell0);
>        Row0.Cells.Add(Cell1);
>
>        this.Controls.Add(tblHeader);
>    }
>}
>
Timothy Bryan
Previous
Reply
Map
View

Click here to load this message in the networking platform