URL format string based on 2 data columns?

  • Thread starter Thread starter jib
  • Start date Start date
J

jib

Hiya,

I have a data grid with one column being a "hyperlink column". I want to use
this column to jump to another aspx page based on two different column
values from the underlying dataset. Setting up a hyperlink based on a single
column is simple:

URL field: VariableA
URL format string: MyPage.aspx?VariableA={0}

Now how would I do this with two variables? The following doesnt work:

URL field: VariableA, VariableB
URL format string: MyPage.aspx?VariableA={0}?VariableB={1}


Ideas anyone?

Jib
 
Try something like this:

<asp:TemplateColumn HeaderText="Edit">
<ItemStyle Width="180px" />
<ItemTemplate>
<asp:HyperLink ID=hlEdit Runat=server NavigateUrl='<%#
"MyPage.aspx?VariableA=
+ DataBinder.Eval(Container.DataItem, VariableA")
+ "&VariableB="
+ DataBinder.Eval(Container.DataItem, VariableB")
%>'>Edit</asp:HyperLink>
</ItemTemplate>
</asp:TemplateColumn>

Scott
 
Back
Top