John,
Use a literal control instead of the hyperlink. The literal control can be
filled with whatever you want and the text inside it will be rendered
without change. Just drop the literal control on the page where you need it
and then use a string builder to create your links like this:
Dim MyStringBuilder As New System.Text.StringBuilder
If x=y Then
MyStringBuilder.Append("<a href=www.msn.com
target=_blank>www.msn.com</a>")
End If
If a=b Then
MyStringBuilder.Append("<a href=www.msn.com
target=_blank>www.msn.com</a><br>")
End If
Literal1.Text = MyStringBuilder.ToString
This way you'll be able to control when you need a break or not.
--
Sincerely,
S. Justin Gengo, MCP
Web Developer / Programmer
www.aboutfortunate.com
"Out of chaos comes order."
Nietzsche
"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:uw****************@TK2MSFTNGP12.phx.gbl...
Works nicely except there are <br>s between each linkbutton and when a
linkbutton is not visible the space is still there giving away the fact
that something is missing. How can I get rid of extra space around a link
when the link is not visible?
Thanks
Regards
"Eliyahu Goldin" <re*************@monarchmed.com> wrote in message
news:uF**************@TK2MSFTNGP14.phx.gbl... Forgot to mention. Likely, you will want to do it in the Page_Load event.
If the conditions are in the data sources you are binding to, you will
want to use either ItemDataBound or PreRender event.
Eliyahu
"Eliyahu Goldin" <re*************@monarchmed.com> wrote in message
news:u9**************@TK2MSFTNGP11.phx.gbl... Make the links to server HyperLinks controls. Set their Visible property
like this:
myLink1.Visible = (x=y)
Eliyahu
"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi
On a webform I need some links to appear only if some condition is met.
Basically I am looking for something like this;
if x=y then
<-- generate html to display the relevant link 1-->
end if
if a=b then
<-- generate html to display the relevant link 2-->
end if
Could someone please provide a link to such an example?
Thanks
Regards