simple question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi guys, i am creating Hyperlink control in the codebehind and adding it to
the panel.
The problem is that they are ending up next to each other without any space
between them.
can someone recomend based on my code how i can get a space about a tab
between each hyperlinks.
here is my code:

HyperLink MyHyperLink = new HyperLink();
MyHyperLink.NavigateUrl = attachment[k].Address.ToString();
MyHyperLink.Text =attachment[k].FileName.ToString();
HyperLink space = new HyperLink();
space.Text=" ";
LHW_PanelAttachment.Controls.Add(MyHyperLink);
LHW_PanelAttachment.Controls.Add(space);

thanks
Manny
 
The problem is you are using spaces instead of   (non-breasking
space)...consider:

HyperLink MyHyperLink = new HyperLink();
MyHyperLink.NavigateUrl = attachment[k].Address.ToString();
MyHyperLink.Text =attachment[k].FileName.ToString();
LHW_PanelAttachment.Controls.Add(MyHyperLink);
Literal lit = new Literal();
lit.Text = "       ";
LHW_PanelAttachment.Controls.Add(lit);

(wasn't sure why your spaces had to be in a hyperlink control, so I put them
in a literal instead, seems to make more sense from what you showed up). If
you need more formatting, you'll need to use a table or something.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/


Manny Chohan said:
How about createing hyperlinks in seperate lines. Either way will help

Manny Chohan said:
hi guys, i am creating Hyperlink control in the codebehind and adding it to
the panel.
The problem is that they are ending up next to each other without any space
between them.
can someone recomend based on my code how i can get a space about a tab
between each hyperlinks.
here is my code:

HyperLink MyHyperLink = new HyperLink();
MyHyperLink.NavigateUrl = attachment[k].Address.ToString();
MyHyperLink.Text =attachment[k].FileName.ToString();
HyperLink space = new HyperLink();
space.Text=" ";
LHW_PanelAttachment.Controls.Add(MyHyperLink);
LHW_PanelAttachment.Controls.Add(space);

thanks
Manny
 
Thanks karl, ill try this

Karl Seguin said:
The problem is you are using spaces instead of (non-breasking
space)...consider:

HyperLink MyHyperLink = new HyperLink();
MyHyperLink.NavigateUrl = attachment[k].Address.ToString();
MyHyperLink.Text =attachment[k].FileName.ToString();
LHW_PanelAttachment.Controls.Add(MyHyperLink);
Literal lit = new Literal();
lit.Text = " ";
LHW_PanelAttachment.Controls.Add(lit);

(wasn't sure why your spaces had to be in a hyperlink control, so I put them
in a literal instead, seems to make more sense from what you showed up). If
you need more formatting, you'll need to use a table or something.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/


Manny Chohan said:
How about createing hyperlinks in seperate lines. Either way will help

Manny Chohan said:
hi guys, i am creating Hyperlink control in the codebehind and adding it to
the panel.
The problem is that they are ending up next to each other without any space
between them.
can someone recomend based on my code how i can get a space about a tab
between each hyperlinks.
here is my code:

HyperLink MyHyperLink = new HyperLink();
MyHyperLink.NavigateUrl = attachment[k].Address.ToString();
MyHyperLink.Text =attachment[k].FileName.ToString();
HyperLink space = new HyperLink();
space.Text=" ";
LHW_PanelAttachment.Controls.Add(MyHyperLink);
LHW_PanelAttachment.Controls.Add(space);

thanks
Manny
 

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

Back
Top