Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Need syntax help building hyperlink

Posted on 2017-03-09
2
Medium Priority
?
76 Views
Last Modified: 2017-03-09
I am having problems with syntax in this function.    It checks the value of every data item in the ItemTemplate of an ASP Repeater. If “_” is found it sets the whole line as a hyperlink, otherwise just displays the line. It is finding the “_” , displaying the text, but the hyperlink is not active.

<ItemTemplate>
        <tr>
            <td class="style14"> <%# CheckValue(DataBinder.Eval(Container.DataItem, "recaPrintScreen").ToString())%> </td>
        </tr>
    </ItemTemplate>

[aspx.vb page]
Public Function CheckValue(v As [String]) As [String]
   If (Left(v, 3)).Contains("_") Then
        Return "<asp:HyperLink " + "ID=HyperLinkCheckValue " + "target=_blank " + "runat=server " +
               " NavigateUrl=./foo.aspx?SearchNumber=" + strSearchNum + "&src=IOD" + "&cty=" + currentCounty + "&plead=" +
               _strPleadingType + "&type=" + strPleadingTypeDetail + "'>" + v + "</asp:HyperLink>"
    Else
       Return v
    End If
End Function
0
Comment
Question by:4ncid
[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
2 Comments
 
LVL 41

Accepted Solution

by:
Kyle Abrahams earned 2000 total points
ID: 42041700
At that point I would just write out the HTML:
 
If (Left(v, 3)).Contains("_") Then
 Return "<a " + "ID='HyperLinkCheckValue' " + "target='_blank' "  + 
               " href='./foo.aspx?SearchNumber=" + strSearchNum + "&src=IOD" + "&cty=" + currentCounty + "&plead=" +
               _strPleadingType + "&type=" + strPleadingTypeDetail + "'>" + v + "</a>"


 Else
       Return v
    End If

Open in new window

0
 

Author Comment

by:4ncid
ID: 42041779
That works! Thanks much.
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

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…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

618 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