URL format string based on 2 data columns?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jib

    #1

    URL format string based on 2 data columns?

    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?Var iableA={0}

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

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


    Ideas anyone?

    Jib


  • S. Spurlock

    #2
    Re: URL format string based on 2 data columns?

    Try something like this:

    <asp:TemplateCo lumn HeaderText="Edi t">
    <ItemStyle Width="180px" />
    <ItemTemplate >
    <asp:HyperLin k ID=hlEdit Runat=server NavigateUrl='<% #
    "MyPage.aspx?Va riableA=
    + DataBinder.Eval (Container.Data Item, VariableA")
    + "&VariableB ="
    + DataBinder.Eval (Container.Data Item, VariableB")
    %>'>Edit</asp:HyperLink>
    </ItemTemplate>
    </asp:TemplateCol umn>

    Scott

    "jib" <jib_0@hotmail. com> wrote in message
    news:O5E4DTLlDH A.3024@tk2msftn gp13.phx.gbl...[color=blue]
    > Hiya,
    >
    > I have a data grid with one column being a "hyperlink column". I want to[/color]
    use[color=blue]
    > 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[/color]
    single[color=blue]
    > column is simple:
    >
    > URL field: VariableA
    > URL format string: MyPage.aspx?Var iableA={0}
    >
    > Now how would I do this with two variables? The following doesnt work:
    >
    > URL field: VariableA, VariableB
    > URL format string: MyPage.aspx?Var iableA={0}?Vari ableB={1}
    >
    >
    > Ideas anyone?
    >
    > Jib
    >
    >[/color]


    Comment

    Working...