?
Solved

Need syntax help building hyperlink

Posted on 2017-03-09
2
Medium Priority
?
67 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 40

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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

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…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

777 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