473,396 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Positioning hyperlinks dynamicaly (in code)

Hi,

I trying to create dinamicaly hyperlinks, which I manage to do with the
following code:

Protected Overrides Sub OnPreRender(ByVal e As EventArgs)

ctl = New HyperLink
ctl.Target = "_blank"
ctl.ID = "hl"
ctl.Text = "Algeco.pt"
ctl.NavigateUrl = "http://www.algeco.pt"
Me.Controls.Add(ctl)

ctl = New HyperLink
ctl.Target = "_blank"
ctl.ID = "h2"
ctl.Text = "Solbinet.pt"
ctl.NavigateUrl = "http://www.solbinet.pt"
Me.Controls.Add(ctl)

MyBase.OnPreRender(e)
End Sub

The question is how can I set the position.

Thanks in advance

CC
Nov 18 '05 #1
2 1152
Try putting your links into a span tag:
Me.Controls.Add(New LiteralControl("<span style=""position:absolute;left:100;top:120;"">")
Me.Controls.Add(ctl)
Me.Controls.Add(New LiteralControl("</span>")

-Stanley
<ca*********@algecog.pt> wrote in message news:%2****************@tk2msftngp13.phx.gbl...

Hi,

I trying to create dinamicaly hyperlinks, which I manage to do with the following code:

Protected Overrides Sub OnPreRender(ByVal e As EventArgs)

ctl = New HyperLink
ctl.Target = "_blank"
ctl.ID = "hl"
ctl.Text = "Algeco.pt"
ctl.NavigateUrl = "http://www.algeco.pt"
Me.Controls.Add(ctl)

ctl = New HyperLink
ctl.Target = "_blank"
ctl.ID = "h2"
ctl.Text = "Solbinet.pt"
ctl.NavigateUrl = "http://www.solbinet.pt"
Me.Controls.Add(ctl)

MyBase.OnPreRender(e)
End Sub

The question is how can I set the position.

Thanks in advance

CC
Nov 18 '05 #2
Put a Placeholder control on your ASPX or ASCX page. Place it where
you want the hyper links to be displayed. Then add the Hyperlink
controls to Placeholder.

Neil

"Stanley" <we*******@nospam-glass-images.com> wrote in message news:<uz**************@TK2MSFTNGP11.phx.gbl>...
Try putting your links into a span tag:
Me.Controls.Add(New LiteralControl("<span
style=""position:absolute;left:100;top:120;"">")
Me.Controls.Add(ctl)
Me.Controls.Add(New LiteralControl("</span>")

-Stanley
<ca*********@algecog.pt> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...

Hi,

I trying to create dinamicaly hyperlinks, which I manage to do with
the following code:

Protected Overrides Sub OnPreRender(ByVal e As EventArgs)

ctl = New HyperLink
ctl.Target = " blank"
ctl.ID = "hl"
ctl.Text = "Algeco.pt"
ctl.NavigateUrl = "http://www.algeco.pt"
Me.Controls.Add(ctl)

ctl = New HyperLink
ctl.Target = " blank"
ctl.ID = "h2"
ctl.Text = "Solbinet.pt"
ctl.NavigateUrl = "http://www.solbinet.pt"
Me.Controls.Add(ctl)

MyBase.OnPreRender(e)
End Sub

The question is how can I set the position.

Thanks in advance

CC
--

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

36
by: Jack Hughes | last post by:
This argument has come up two or three times lately. We have a web standards document at our company that say "Use valid HTML 4; We don't recommend switching to DIV-based CSS-P for layout just...
3
by: minigitoo | last post by:
Hi I try to get dynamicaly all requests made to DB2 I process like this: 1) I stop then start my instance of database in the db2 control center 2) I use : db2 update monitor switches using...
0
by: Tim | last post by:
Access 97: I have a table with a hyperlink field that I display on a form. I can click on the form field and the hyperlink activates correctly. However, if I try to activate the hyperlink using VB...
3
by: Bill Zack | last post by:
I have an interesting little ASP.NET problem. I have to position and show multiple "frames" in an IE6 browser at run time in a singe ASP.NET page. Each "frame" will contain a couple of...
4
by: Tim Marsden | last post by:
Hi I would like to add controls to my page at runtime. What containers can I use to host the controls? I know I can add them to the form controls collection, but I need to have control on where...
8
by: Martin Eyles | last post by:
Hi, I have an asp.net page, which uses the response.write method calls in the Page_Load method to output dynamically to the page. Unfortunately, this always inserts text at the beginning of the...
2
by: Achim Domma (Procoders) | last post by:
Hi, to allow my user to select from a list of values which are calculated on the fly, I tried to generate a list of LinkButton controls on the fly. But the connected event does not fire. ...
0
by: =?Utf-8?B?R2FyeSBMYXJpbWVy?= | last post by:
On an aspx page I have text that is a Hyperlink to an html page. The text is not on a button, but is just plain text that has been converted to a Hyperlink. Is it possible to specify or change...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.