469,578 Members | 1,287 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,578 developers. It's quick & easy.

Multiple elements within a datagrid querystring

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
ca**********@m-s-solutions.co.uk
Nov 17 '05 #1
2 6697
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,"Order ID")%>' 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>
--
Saravana
Microsoft India Community Star,
MCAD,SE,SD,DBA.
"Carl Howarth" <ca**********@m-s-solutions.co.uk> wrote in message
news:uK**************@tk2msftngp13.phx.gbl...
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
ca**********@m-s-solutions.co.uk

Nov 17 '05 #2
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,"Order ID")%>' 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>
--
Saravana
Microsoft India Community Star,
MCAD,SE,SD,DBA.
"Carl Howarth" <ca**********@m-s-solutions.co.uk> wrote in message
news:uK**************@tk2msftngp13.phx.gbl...
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
ca**********@m-s-solutions.co.uk

Nov 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Amy | last post: by
1 post views Thread by aylin_sk | last post: by
1 post views Thread by aylin_sk | last post: by
32 posts views Thread by tshad | last post: by
reply views Thread by Carl Howarth | last post: by
7 posts views Thread by Joe | last post: by
7 posts views Thread by CanoeGuy | last post: by
2 posts views Thread by =?Utf-8?B?TWlrZQ==?= | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.