473,569 Members | 2,782 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(ByV al 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.p t"
ctl.NavigateUrl = "http://www.solbinet.pt "
Me.Controls.Add (ctl)

MyBase.OnPreRen der(e)
End Sub

The question is how can I set the position.

Thanks in advance

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

-Stanley
<ca*********@al gecog.pt> wrote in message news:%2******** ********@tk2msf tngp13.phx.gbl. ..

Hi,

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

Protected Overrides Sub OnPreRender(ByV al 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.p t"
ctl.NavigateUrl = "http://www.solbinet.pt "
Me.Controls.Add (ctl)

MyBase.OnPreRen der(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*******@nosp am-glass-images.com> wrote in message news:<uz******* *******@TK2MSFT NGP11.phx.gbl>. ..
Try putting your links into a span tag:
Me.Controls.Add (New LiteralControl( "<span
style=""positio n:absolute;left :100;top:120;"" >")
Me.Controls.Add (ctl)
Me.Controls.Add (New LiteralControl( "</span>")

-Stanley
<ca*********@al gecog.pt> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..

Hi,

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

Protected Overrides Sub OnPreRender(ByV al 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.p t"
ctl.NavigateUrl = "http://www.solbinet.pt "
Me.Controls.Add (ctl)

MyBase.OnPreRen der(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
4088
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 yet though, tables are a lot easier." That's because we have a lot of developers who aren't ready to move to CSS-P and DIVs just yet. But I'm...
3
1682
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 statement on 3) then: db2 get snapshot for dynamic sql on <MyDatabase> I manage to get logs between instant t1 and t2, but i would like to see...
0
466
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 code, the last hyperlink that was clicked is the only one that displays. Background: The database is for providing instruction documentation for...
3
1441
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 navigation links and one chart object (currently an ActiveX control but we will be switching to native .NET controls soon). The number of frames shown on...
4
2045
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 they are placed. For example I would like a page header and footer, menu on the left, text on the right and an area in the middle where I can add...
8
1261
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 file, before the <!DOCTYPE...> definition. I would like to control the position, so that it always appears in a certain place in my code (within a div...
2
1282
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. Searching google I found out that the problem is caused by the structure of the ASP.Net event handling: The clicked button does not exist anymore after...
0
813
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 the URL associated with the Hyperlink in the Page_Load() event (or another type of code handler) before or after the Hyperlink is clicked. Thanks...
0
7612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7672
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7968
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5512
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1212
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.