Add controls at runtime

J

JezB

I have a page that is in Flow layout mode. I'm adding a list of hyperlinks
programatically with code such as :

HyperLink h = new HyperLink();
h.Text = pDesc;
h.NavigateUrl = "placeholders0.aspx?grp="+pGrp;
Page.Controls.Add(h);

(in a loop). The problem is that these appear all on one line on my page, as
in :

Link1Link2Link3

How can I force each link to be on a new line ?
 
P

Patrice Scribe

Same as if you were coding HTML by hand. Yo'ull have to add whatever you
want (BR tags for example) in between...

Patrice
 
J

JezB

Ah but I'm new to web programming and have never done any HTML ! But I have
found out what you mean - thanks.
 
P

Patrice Scribe

Ok sorry. Just for completeness, most elements are just displayed "in line".
You have explictely to express that you want to go to the next line...

Welcome to the Web ;-)

--
 
Joined
Jul 26, 2006
Messages
1
Reaction score
0
Hi there,

You can do it easily.
h.Text = pDesc + "<BR>"

That would display each link on a new line

happy coding..
;)
Siva
 

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,774
Messages
2,569,598
Members
45,149
Latest member
Vinay Kumar Nevatia0
Top