newbie: My panel doesn't wrap content!

J

Jeff

Hey

asp.net 2.0

In the OnLimit method of the webpage I add several HyperLinks to a Panel.
Panel.Wrap = true (default). But during runtime the wrap doesn't work: It
just continue to add new Hyperlinks to the same line in the Panel even if
the line is full already...

What am I doing wrong here?

<asp:TableRow Height="100">
<asp:TableCell ColumnSpan="2" VerticalAlign="Top"
HorizontalAlign="Left">
<asp:panel ID="Panel1" runat="server" Height="100%"
Width="350px" BackColor="Beige" Wrap="true">
</asp:panel>
</asp:TableCell>
</asp:TableRow>


protected override void OnInit(EventArgs e)
{
HyperLink hyperlink = new HyperLink();
hyperlink.Text = "helloworld";
hyperlink.NavigateUrl = "www.vg.no";
hyperlink.Target = "_blank";


double Rwidth = 0;

hyperlink = new HyperLink();
hyperlink.ID = "hyperlink1";
hyperlink.Text = "helloworld1";
hyperlink.Font.Size = 16;
//hyperlink.Font.Bold = true;
hyperlink.NavigateUrl = "www.vg.no";
hyperlink.Target = "_blank";
Panel1.Controls.Add(hyperlink);
Rwidth = hyperlink.Width.Value;

hyperlink = new HyperLink();
hyperlink.Text = "helloworld2";
hyperlink.NavigateUrl = "www.vg.no";
hyperlink.Target = "_blank";
Panel1.Controls.Add(hyperlink);
Rwidth = hyperlink.Width.Value;

hyperlink = new HyperLink();
hyperlink.Text = "helloworld3";
hyperlink.NavigateUrl = "www.vg.no";
hyperlink.Target = "_blank";
Panel1.Controls.Add(hyperlink);
Rwidth = hyperlink.Width.Value;

hyperlink = new HyperLink();
hyperlink.Text = "helloworld4";
hyperlink.NavigateUrl = "www.vg.no";
hyperlink.Target = "_blank";
Panel1.Controls.Add(hyperlink);
Rwidth = hyperlink.Width.Value;

hyperlink = new HyperLink();
hyperlink.Text = "helloworld5";
hyperlink.NavigateUrl = "www.vg.no";
hyperlink.Target = "_blank";
Panel1.Controls.Add(hyperlink);
Rwidth = hyperlink.Width.Value;

hyperlink = new HyperLink();
hyperlink.Text = "helloworld6";
hyperlink.NavigateUrl = "www.vg.no";
hyperlink.Target = "_blank";
Panel1.Controls.Add(hyperlink);
Rwidth = hyperlink.Width.Value;


}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,818
Latest member
Brigette36

Latest Threads

Top