473,405 Members | 2,176 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,405 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 6876
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.