Solved

Href in stringbuilder ?field=  value sent - vb.net sytnax help needed

Posted on 2014-04-02
4
619 Views
Last Modified: 2014-04-02
I am using stringbuilder to generate a listing of program with counts. I placed hyperlink on each program line and when clicked, send to a detail report page of the data. I have all the sytnax working but adding the program name is not coded correctly. I get full link but without the program value sent.
attaching detail doc file.
Stringbuilder.doc
0
Comment
Question by:mahpog
  • 3
4 Comments
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 500 total points
ID: 39972778
Do you mean you are not getting a value from reader3("program") at all, or just that the link isn't formed properly?

Looking at your code, i'd think you'd want something more like:
sb1.AppendFormat("<tr><td align=left>{0}</td><td align=center", reader("program"))
sb1.AppendFormat("<a href='top_graph1_b.aspx?program={0}''", reader3("program"))
sb1.Append("style= '" & "color:navy;font-weight:bolder;" & "' >")
sb1.Append(reader3("cntpgm"))
sb1.Append("</a>")
sb1.Append("</td>")
sb1.Append("</tr>")

Open in new window

0
 

Author Comment

by:mahpog
ID: 39972918
the link top_graph1_b.aspx?program= is not formed properly. All other code works perfect.
0
 

Author Comment

by:mahpog
ID: 39972925
here is final code and works! perfectly.

                sb1.Append("<tr><td align=left>")
                sb1.Append(reader3("program"))
                sb1.Append("</td><td align=center>")
                sb1.AppendFormat("<a href='top_graph1_b.aspx?program={0}''", reader3("program"))
                sb1.Append(" & style= '" & "color:navy;font-weight:bolder;" & "' >")
                sb1.Append(reader3("cntpgm"))
                sb1.Append("</a>")
                sb1.Append("</td>")
                sb1.Append("</tr>")

thx for the format. I tried Appendformat but did not use as you coded.
0
 

Author Closing Comment

by:mahpog
ID: 39972926
did the trick!
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question