Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2014-04-02
4
Medium Priority
?
651 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 2000 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
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…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

722 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