navigateURL query string

Posted on 2009-04-19
Last Modified: 2012-05-06
Hello, I have the following navigateURL querystring that works great:
NavigateUrl='<%# Eval("ArticleId", "~/search.aspx?ArticleId={0}&type=" & Request.QueryString("ArticleId")) %>' Text='<%# Eval("Title") %>'

I need to add an additional querystring value "SearchText" to the above. The value for "SearchText" comes from a label on the same page called lblSearchText.

How can this be accomplished
Question by:gogetsome
    LVL 12

    Accepted Solution

    when i have a complicated binding to do, sometimes its just easier to call a page lvel method to return the string i want. Here the hyperlink in a template column gets its navigateurl proeprty filled by a page method called GetMyNavigateUrl.

    The values in the method are obviously based on my sql data source, so you to tweak that aspect of it

    <asp:HyperLink ID="hl1" runat="server" NavigateUrl="<%# GetMyNavigateUrl(Container.DataItem) %>" Text='<%# Eval("PrimaryID") %>' />
    public string GetMyNavigateUrl(object o)
        DataRowView drv = (DataRowView)o;
        DataSet1.TestTableRow ttr = (DataSet1.TestTableRow)drv.Row;
        return string.Format("~/search.aspx?ArticleId={0}&type={1}&lbl={2}",

    Open in new window

    LVL 12

    Expert Comment

    did that help gogetsome?

    Author Closing Comment

    Yes, thank you!

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Suggested Solutions

    Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (…
    This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    731 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

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now