[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 629
  • Last Modified:

navigateURL query string

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
0
gogetsome
Asked:
gogetsome
  • 2
1 Solution
 
wht1986Commented:
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}",
        Request.QueryString("ArticleId"),
        ttr.Column1,
        this.label1.Text);
}

Open in new window

0
 
wht1986Commented:
did that help gogetsome?
0
 
gogetsomeAuthor Commented:
Yes, thank you!
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.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now