Solved

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

Posted on 2014-04-02
4
604 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

705 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now