Guest raemdop Posted July 24, 2002 Posted July 24, 2002 hi, I have some code where I create an array of hyperlinks and put them on a webform. Is there a way to position the Hyperlinks on this webform, because they are all one 1 horizontal line on top of the page. Thanks for reading my problem Raemdop Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Put user code to initialize the page here Dim sid() As HyperLink Dim i As Integer For i = 0 To 100 Dim hl As New HyperLink() ReDim sid(i) hl.NavigateUrl = "targetPage.aspx" hl.Text = "test" sid(i) = hl 'this does not work !!!!!!!!!!!!!!!! sid(i).Style.Item("top") = 100 + i sid(i).Style.Item("left") = 50 Me.Controls.Add(sid(i)) Next i End Sub Quote
Moderators Robby Posted July 24, 2002 Moderators Posted July 24, 2002 I'm guessing this is .NET Quote Visit...Bassic Software
*Experts* Bucky Posted July 24, 2002 *Experts* Posted July 24, 2002 Because you're only increasing the loop by one, you're only setting it to one pixel above the hyperlink before it (100 + i). I suggest you multiply "i" by something to move the link down on the page more, maybe something like this: sid(i).Style.Item("top") = 100 + (i * 20) That example will put the hyperlink 20 pixels below the last one. You might have to increase the number you're multiplying by to get them in the right position. HTH And yes Robby, this is VB.NET. (actually ASP.NET, but it's close enough) :) Quote "Being grown up isn't half as fun as growing up These are the best days of our lives" -The Ataris, In This Diary
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.