473,320 Members | 2,035 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,320 software developers and data experts.

Use asp:Table in aspx.vb with hyperlinks

Expand|Select|Wrap|Line Numbers
  1. Dim I As Integer
  2. Dim needfooter As boolean
  3. Dim Literal1 As New Literal()
  4. Define_List1_Data()
  5.  
  6. Dim html As New StringBuilder() 'Building an HTML string.
  7. html.Append("<table border = '1' cellspacing=\'0\' cellpadding=\'2\' border=\'1\'><tr>")      'Table start.
  8.         For I = 1 to 8
  9.             html.Append("<th>column " & i & "</th>")
  10.         Next
  11.       html.Append("</tr>")       'Building the Data rows.
  12.         for I = 1 to 88
  13.         needFooter = true
  14.         if I mod 8 = 0 then html.Append("<tr>")
  15.     html.Append("<TD align = 'center'>")
  16. **Here is my problem **
  17. I want the cells to be links to a Sub in this page but it won't accept what I typed.
  18.     html.Append("<A HREF='javascript:DisplayConstellations(I)'>" & ConName(I) & "</A>")
  19.     html.Append("</TD>")
  20.         if I mod 8 = 8 Then
  21.             html.Append("</tr>")
  22.             needFooter = false
  23.     End If
  24.      Next
  25.         html.Append("</table>")        'Table end.
  26. PlaceHolder1.Controls.Add(New Literal() With{.Text=html.ToString()})
Any suggestions to allow it to link to the Sub?
Dec 10 '15 #1
3 1387
Luk3r
300 256MB
Your "DisplayConstellations(I)" is not accepted because your integer is inside of quotes. Try using something like this:

Expand|Select|Wrap|Line Numbers
  1. Html.Append("<A HREF=javascript:DisplayConstellations(" & I & ")>" & ConName(I) & "</A>")
Dec 10 '15 #2
That didn't work. I use html.Append("<A HREF='#DisplayConstellations(" & I & ")'>" & ConName(I) & "</A>") Notice that single quote marks are needed for javascript as html.Append use double quotes. I see at the bottom of my browser that it displays localhost/program name/page name/#sub to go to when I hover the mouse over the desired cell but it doesn't do anything. If I put in a page name then it would probably go to that page but the sub I want to use is in this page.
Dec 10 '15 #3
Html.Append("<a href='javascript:DisplayConstellations(" & I & ")';>" & ConName(I) & "</a></TD>") I finally ended up using javascript in aspx page to receive the click. I was trying to get away from javascript and learn asp.net with vb.net. This is only faking it with javascript and not using aspx.
Dec 12 '15 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: acconrad | last post by:
We're trying to make it such that you can change the color for hyperlinks in RichTextBox controls. Currently VS.NET '03 does not allow one to do this. We tried this -->...
3
by: Rob Meade | last post by:
Hi all, I've tried to add a hyperlink object inside a label object and its not having any of it...any ideas? Code below.. ' Declare variables Dim Link As Hyperlink
6
by: Paolo Pignatelli | last post by:
I have an aspx code behind page that goes something like this in the HTML view: <asp:HyperLink id=HyperLink1 runat="server" NavigateUrl='<%#"mailto:" &amp;...
5
by: Patrick.O.Ige | last post by:
What are the best ways to hide hyperlinks from visitors? Any ideas
1
by: rcoco | last post by:
Hi all, I have this big problem with hyperlinks I would appriciate any help please. My web site has two datagrids on the same page. And one has a list of names of the users which are in form of...
2
by: Nathan | last post by:
I'm trying to use a LocalReport in a ReportViewer and make a couple fields in the report show up as hyperlinks so I can navigate to other pages after running the report. The hyperlinks themselves...
3
by: =?Utf-8?B?UmlkZ2V3YXk=?= | last post by:
I am using PowerPoint 2000 with a very large presentation with many Hyperlinks, mostly to other slides but many also to Internet links. Recently, some of them are not working. I correct them on...
0
by: MyteC | last post by:
I'm trying to get hyperlinks to edit my table entries and it is not working. MakeDataTable(dtSelDate) does the bulk of the work populating the data table _dt which contains all the event...
0
by: tess1243 | last post by:
How to store youtube video hyperlinks into sql database? And set it up on aspx page?
1
by: tess1243 | last post by:
How to store youtube video hyperlinks into sql database? And set it up on aspx page?
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.