Multiple elements within a datagrid querystring

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)
 
S

Saravana

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>
 

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

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top