URL format string based on 2 data columns?

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
 
S

S. Spurlock

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top