473,563 Members | 2,797 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Pass Paramter from Repeater - Can't Figure This Out

Hi,

I have a repeater based on a stored procedure. It pulls the following:

catDesc Image

The user sees the category description (catDesc) , and then clicks on
the image (Image) which is bound to the catID. This catID (@catID ---
an integer) is then to be passed to the next page, sculpture2.aspx for
use in a datagrid with a stored procedure.

I understand how to pass a parameter using response.redire ct. I've
done so with a dropdownlist in the past by using OnSelectedIndex Changed
and just using dropdownlist.se lecteditem.valu e as the parameter (an
integer in this case) which I use with response.redire ct.

Is there an equivalent techinque for using a repeater?

Here is my code:

<asp:repeater runat="server" ID=repeaterOdd>
<itemtemplate >
<p align="left"><% #DataBinder.Eva l(Container.Dat aItem,
"catDesc") %></p>
<p align="left">
<a href="sculpture 2.aspx?catDesc= <%#DataBinder.E val(Container.D ataItem,
"catID")%>"
<img src="<%# DataBinder.Eval (Container.Data Item, "image") %>"></p>
</itemtemplate>
</asp:repeater>

If I pass this parameter as CatID, then I can't retrieve it using a
querysting, and the whole goal is to use a querystring to pass the
parameter. (e.g int passedValue = Request.Queryst ring["catID"].

Is there some way to pull the selected value of catID out of the
repeater, put it in some kind of variable, and then run a method to
attach it to a response.redire ct?

Is there another way to do this? Using a LinkButton?

Thanks in advance.

May 3 '06 #1
2 4592
you can replace the image tag with an asp:HyperLink that way the user can
click on the image and be redirected to a page with your catID accesible
thus:
<asp:HyperLin k id="HyperLink1 " runat="server" ImageUrl="<%#
DataBinder.Eval (Container.Data Item, "image") %>"
NavigateUrl=sec ondpage.aspx?ca iID=<%#DataBind er.Eval(Contain er.DataItem,
"catID")%>" ></asp:HyperLink>

"Ranginald" <da*******@gmai l.com> wrote in message
news:11******** **************@ y43g2000cwc.goo glegroups.com.. .
Hi,

I have a repeater based on a stored procedure. It pulls the following:

catDesc Image

The user sees the category description (catDesc) , and then clicks on
the image (Image) which is bound to the catID. This catID (@catID ---
an integer) is then to be passed to the next page, sculpture2.aspx for
use in a datagrid with a stored procedure.

I understand how to pass a parameter using response.redire ct. I've
done so with a dropdownlist in the past by using OnSelectedIndex Changed
and just using dropdownlist.se lecteditem.valu e as the parameter (an
integer in this case) which I use with response.redire ct.

Is there an equivalent techinque for using a repeater?

Here is my code:

<asp:repeater runat="server" ID=repeaterOdd>
<itemtemplate >
<p align="left"><% #DataBinder.Eva l(Container.Dat aItem,
"catDesc") %></p>
<p align="left">
<a href="sculpture 2.aspx?catDesc= <%#DataBinder.E val(Container.D ataItem,
"catID")%>"
<img src="<%# DataBinder.Eval (Container.Data Item, "image") %>"></p>
</itemtemplate>
</asp:repeater>

If I pass this parameter as CatID, then I can't retrieve it using a
querysting, and the whole goal is to use a querystring to pass the
parameter. (e.g int passedValue = Request.Queryst ring["catID"].

Is there some way to pull the selected value of catID out of the
repeater, put it in some kind of variable, and then run a method to
attach it to a response.redire ct?

Is there another way to do this? Using a LinkButton?

Thanks in advance.

May 3 '06 #2
Thanks for your response. How would I then pull the value?
Still with respons.queryst ring?

Thanks again.

May 3 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
4386
by: Neal | last post by:
I need to know how to pass a parameter from PERL to an XSLT when using that XSLT to transform XML. For instance, I'd like to pass a paramter that I retrieve from the queryString and pass it into XSLT which will create my HTML. Here's what I have for the basic transformation: #!/usr/local/bin/perl use XML::XSLT;/
1
23497
by: Dion Heskett | last post by:
How can I pass a Class as a parameter to in a method ? i.e. Private myMethod( string pram1, Classobject as pram2) { Classobject.DataSource = reader; Classobject.DataBind(); }
7
1990
by: Scott Schluer | last post by:
Hi All, I have a functioning datagrid on "Page 1" that displays order information for a single order (this is for an e-commerce site). It's actually a combination of a couple datagrids to display all of the information. I now have a need to drop this datagrid into a repeater on "Page 2". The repeater will grab ALL orders within a given...
4
1710
by: bob garbados | last post by:
I need to create a page that displays all of the products from a table and allows for add to cart functionality. My thoughts were to display all of the products in table rows using a repeater. Each row has a text box for quantity to order and a button to add the product and quantity to the shopping cart. I can dynamically assign the...
1
2919
by: Keith Harris | last post by:
Hi, I have a Repeater control which is bound to a dataset. In the footer of the repeater control, I have a Button whose visibility I want to vary according to the sum of a column being > 0. I have tried to set the button's visibility in Page_Load (after data binding), but I get a NullReferenceException stating that "Object reference not...
3
2841
by: WebMatrix | last post by:
I am struggling with implementing somewhat complicated UI web-control. I explored Repeater, but I am not sure if it's the best way to go. I am leaning towards writing my own custom control and creating elements on the fly dynamically. I have a control that needs to display 3 columns and n number of rows depending on number of records. Sounds...
8
2900
by: I am Sam | last post by:
Hi everyone, This problem is making me old. I don't want to get any older. I have a multi-nested repeater control as follows: <asp:Repeater ID="clubRep1" Runat="server"> <HeaderTemplate><table> </HeaderTemplate> <ItemTemplate>
1
1805
by: jacobyv | last post by:
hi i created survey.asp which displays the survey passed through the name paramter in the url. it works fine if i open the page like this. http://url/survey.asp?name=survey1 but now i would like to include survey.asp in a different asp file, let's call it main.asp, and display several surveys.
12
2152
by: =?Utf-8?B?Qi4gQ2hlcm5pY2s=?= | last post by:
I'm doing a web app in VB/Dot Net 2.0. I'm probably a bit rusty and I have no experience using the repeater control. I have a user control I've created with multiple properties. I've created a test page and I've managed to bind the usercontrol to a repeater and display some data in the following fashion: <asp:Repeater ID="Repeater1"...
0
7583
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7888
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7642
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6255
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5484
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2082
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1200
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.