473,324 Members | 2,193 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

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 6869
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Amy | last post by:
All, I'd like to use multiple querystring in hyperlink column in Datagrid I want to create a hyperlink column in my datagrid which contains two query strings ex:...
1
by: aylin_sk | last post by:
I cant bind my datagrid..There isnt any problem with dataset....what else can the problem be?? private void Page_Load(object sender, System.EventArgs e) { if (Page.IsPostBack) return; if...
1
by: aylin_sk | last post by:
I'm trying to list my data into my datagrid creating stored procedures in oracle db..My data includes questions for a survey....It's simple but i cant see my datagrid in my web form..I'm now going...
32
by: tshad | last post by:
Can you do a search for more that one string in another string? Something like: someString.IndexOf("something1","something2","something3",0) or would you have to do something like: if...
0
by: Carl Howarth | last post by:
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...
6
by: Shashi | last post by:
I have developed ASP.Net application using .Net 1.1 Framework. When the user clicks image file through Java script I am using my search window as below. QueryString =...
7
by: Joe | last post by:
Hi, I’m new to asp.net. I want to create an asp.net page that allows user to edit the data. I have pasted my code below. I am able to display the data in a datagrid. At the bottom of the page...
7
by: CanoeGuy | last post by:
I have been trying for the last two weeks to display a dynamic DataGrid. The data that I'm pulling from a SQL Server DB will have whole columns that will be either NULL or 0. I want to display...
2
by: =?Utf-8?B?TWlrZQ==?= | last post by:
Hi. I've built an asp.net website, which is displayed within an IFRAME of a classic asp site. The asp.net site consists simply of one page having a paginated gridview control. When my asp.net...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.