Solved

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

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Data Analysis 7 59
vb.net code 9 28
dropdownlist in asp.net vb. 3 21
VB .net 2010 Byte array 2 21
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…

734 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