Multiple elements within a datagrid querystring

  • Thread starter Thread starter Carl Howarth
  • Start date Start date
C

Carl Howarth

Hi,

I need to bind data to a datagrid and have a custom hyperlink column that
has multiple elements in the querystring:

Page.aspx?1=Hello&2=Goodbye...

The query string needs to be populated from different values in the
database. How can I therefore allow for this in the template rather than
having to create a custom field in my stored procedure as the following will
not work!:

NavigateUrl='SelectCriteria.aspx?Database=<%# DataBinder.Eval(Container,
"DataItem.lsID") %>&Table=<%# DataBinder.Eval(Container, "DataItem.tblID")
%>&QueryID=<%# DataBinder.Eval(Container, "DataItem.QueryID") %>'

Many thanks in anticipation,

Carl
(e-mail address removed)
 
It is possible try this,
<asp:DataGrid id="DataGrid1" AutoGenerateColumns="False" style="Z-INDEX:
101; LEFT: 66px; POSITION: absolute; TOP: 79px" runat="server">

<Columns>

<asp:TemplateColumn HeaderText="Order">

<ItemTemplate>

<asp:Hyperlink runat="server"
Text='<%#DataBinder.Eval(Container.DataItem,"OrderID")%>' NavigateUrl='<%#
"page.aspx?Orderid=" + DataBinder.Eval(Container.DataItem,"Orderid") +
"&ProductID=" + DataBinder.Eval(Container.DataItem,"ProductID")%>'
ID="Hyperlink1" NAME="Hyperlink1"/>

</ItemTemplate>

</asp:TemplateColumn>

</Columns>

</asp:DataGrid>
 
Back
Top