Solved

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

Posted on 2014-04-02
4
626 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
using CK editor in iframes 5 27
Validating textboxes in red square borders. 2 33
vb.net sendkey 4 18
Connect Gridview column to Textbox in C# 2 38
Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
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…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

756 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