473,503 Members | 1,673 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Link from Repeater

Hi,

I'm trying to do the following:
I use a repeater control in ASP.NET/C# because I would like to show the
content of one DataSet which is filled from SELECT QUERY.
In DataSource I have the detailed information for all advertisements which
met the criteria of the QUERY.
With the Repeater I show only one part from this information. In other words
if I have in DataSet 12 columns, I show 6.
What I would like to do is to make the first column ,which the Repeater
shows, a HyperLink to the detailed information of the advertisement.

Repeater shows the following:

TypeEstate Price SquareMeters City
Date RealName
================================================== ============
house $333000 500 Sofia
23/08/03 Viktor Popov
apartment $450000 200 Plovdiv
24/07/04 Ilian Peev
...........

What I'm trying to do is to make the TypeEstate link to the detailed
info for the specific advertisement and to show this information in another
WebForm.
How could be accomplished that ?

This is the code which I use now:

C#:
========

private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
SqlConnection conn = new SqlConnection("Data Source=BLEK;Initial
Catalog=Estate; User ID=blek; Password=banderas");
SqlDataAdapter dad = new SqlDataAdapter("SELECT
U.REALNAME,E.ADDATE,ET.TYPEEST,O.PRICE,O.SQMETERS, E.ESTCITY FROM BLEK.USERS
U RIGHT JOIN BLEK.OFFERS O ON U.USERID=O.USERID LEFT JOIN BLEK.ESTATES E ON
O.ESTATEID=E.ESTATEID LEFT JOIN BLEK.Est_TYPE AS ET ON E.ESTTYPEID=ET.TYPEID
LEFT JOIN BLEK.TYPEOFFER AS OT ON E.TYPEOFFERID=OT.OFFERID LEFT JOIN
BLEK.TYPECONSTRUCTION AS TC ON E.TYPECONSTRID=TC.CONSTRID WHERE
E.ESTCITY=@CITY AND OT.TYPEOFFER=@TOFFER", conn);
conn.Open();
dad.SelectCommand.Parameters.Add(new SqlParameter("@CITY",
SqlDbType.VarChar,20));
dad.SelectCommand.Parameters["@CITY"].Value = Session["city"].ToString();
dad.SelectCommand.Parameters.Add(new SqlParameter("@TOFFER",
SqlDbType.VarChar,20));
dad.SelectCommand.Parameters["@TOFFER"].Value = Session["offer"].ToString();
DataSet ds = new DataSet();
dad.Fill(ds, "Users");
conn.Close();
MyRepeater.DataSource = ds.Tables["Users"].DefaultView;
MyRepeater.DataBind();
}

HTML
===========

<asp:Repeater id="MyRepeater" runat="server">
<HeaderTemplate>
<table width="100%" style="font: 8pt verdana">
<tr style="FONT-WEIGHT: bold; COLOR: #ffffff; BACKGROUND-COLOR:
#c00000">
<th>
TypeEstate
</th>
<th>
Price
</th>
<th>
SquareMeters
</th>
<th>
City
</th>
<th>
Date
</th>
<th>
Sender
</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr style="background-color:FFDEAD; COLOR:#c00000">
<td>
<%# DataBinder.Eval(Container.DataItem, "typeest") %>
</td>
<td>
<%# DataBinder.Eval(Container.DataItem, "price", "EU {0}") %>
</td>
<td>
<%# DataBinder.Eval(Container.DataItem, "sqmeters") %>
</td>
<td>
<%# DataBinder.Eval(Container.DataItem, "estcity") %>
</td>
<td>
<%# DataBinder.Eval(Container.DataItem, "addate" ) %>
<td>
<%# DataBinder.Eval(Container.DataItem, "realname" ) %>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.729 / Virus Database: 484 - Release Date: 27.7.2004 a.
Nov 16 '05 #1
0 1175

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

Similar topics

2
11988
by: Stan | last post by:
I cannot make the link buttons fire ItemCommand from repeater control. Here is the code: <asp:repeater id=rptLetters runat="server"> <itemtemplate> <asp:linkbutton id="lnkLetter"...
8
4263
by: Invalidlastname | last post by:
Hi, We are developing an asp.net application, and we dynamically created certain literal controls to represent some read-only text for certain editable controls. However, recently we found an issue...
1
1686
by: Viktor Popov | last post by:
Hi, I'm trying to do the following: I use a repeater control in ASP.NET/C# because I would like to show the content of one DataSet which is filled from SELECT QUERY. In DataSource I have the...
1
1459
by: darrel | last post by:
I have a form that has a 'sub-form' in it that updates a separate table. I can easily add records to this table from within this page. To delete, though, I've been redirecting to a different...
8
2893
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">...
3
4108
by: Shimon Sim | last post by:
I put linkbutton in a repeater header. I attached event handler in makeup as onclick="btnSort_Click". Made btnSort_Click method public. It doesn't fire if I click on it. I tried to attach it in...
1
1808
by: Imran Aziz | last post by:
Hello All, I have an asp:linkbutton in a repeater control, what I want to do is when someone clicks the link button I should get a value for the link button, and accordingly do some action. How...
2
1905
by: GD | last post by:
I'd like to use a Repeater to display data coming back from a cross-tab report. Because it's a cross-tab, I generally don't know how many columns are coming back. They do follow a certain format: ...
0
2044
by: wassimdaccache | last post by:
Hello Experts; I have a wireless router TP-link I made security phrase for it. What i am trying to do is to configure a d-link access point as a repeater for the TP-link and always not...
0
7198
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
7271
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,...
1
6979
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
5570
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,...
1
4998
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...
0
3160
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1498
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 ...
1
730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
373
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...

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.