473,396 Members | 2,076 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,396 software developers and data experts.

Repeater question.

I am showing a table using repeater control and template for row has a
<asp:TextBox id=txtQuantity runat="server">

Where do i keep the record id in database for that row? Should i create the
hidden field for each row or is there better solution?

so later i could update it in the database.

Here is the code
private void btnUpdate_Click(object sender,
System.Web.UI.ImageClickEventArgs e)
{
foreach( RepeaterItem objItem in Repeater1.Items )
{
TextBox txtBox = objItem.FindControl("txtQuantity");
//need record id for an update?????
}
}
Thanks.
George.
Nov 18 '05 #1
2 960
George,

You can always use the DataList control, which a DataKey field built in.
But, the problem with that DataList is that it uses HTML Tables, which I
don't prefer in some cases, as it is hard to control the design. You can
use a HTMLHiddenInput field or i've used an invisible Literal control.

ASPX:
<asp:Literal id=RecordID visible=false ...

Code:
RecordID objItem.FindControl("RecordID").Text

-- Alex Papadimoulis

"George Ter-Saakov" <no****@hotmail.com> wrote in message
news:ec**************@TK2MSFTNGP11.phx.gbl...
I am showing a table using repeater control and template for row has a
<asp:TextBox id=txtQuantity runat="server">

Where do i keep the record id in database for that row? Should i create the hidden field for each row or is there better solution?

so later i could update it in the database.

Here is the code
private void btnUpdate_Click(object sender,
System.Web.UI.ImageClickEventArgs e)
{
foreach( RepeaterItem objItem in Repeater1.Items )
{
TextBox txtBox = objItem.FindControl("txtQuantity");
//need record id for an update?????
}
}
Thanks.
George.

Nov 18 '05 #2
As i found out from MDSN if the DataList is set to RepeatLayout.flow then no
TABLE structure is generated.

So it worked fine form me.

Thanks for the suggestion.
George.

"Alex Papadimoulis" <alexp-at-halogenstudios.com> wrote in message
news:ep**************@TK2MSFTNGP11.phx.gbl...
George,

You can always use the DataList control, which a DataKey field built in.
But, the problem with that DataList is that it uses HTML Tables, which I
don't prefer in some cases, as it is hard to control the design. You can
use a HTMLHiddenInput field or i've used an invisible Literal control.

ASPX:
<asp:Literal id=RecordID visible=false ...

Code:
RecordID objItem.FindControl("RecordID").Text

-- Alex Papadimoulis

"George Ter-Saakov" <no****@hotmail.com> wrote in message
news:ec**************@TK2MSFTNGP11.phx.gbl...
I am showing a table using repeater control and template for row has a
<asp:TextBox id=txtQuantity runat="server">

Where do i keep the record id in database for that row? Should i create

the
hidden field for each row or is there better solution?

so later i could update it in the database.

Here is the code
private void btnUpdate_Click(object sender,
System.Web.UI.ImageClickEventArgs e)
{
foreach( RepeaterItem objItem in Repeater1.Items )
{
TextBox txtBox = objItem.FindControl("txtQuantity");
//need record id for an update?????
}
}
Thanks.
George.


Nov 18 '05 #3

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

Similar topics

1
by: Fraggle | last post by:
I have a repeater with controls added at run time. the <template> also contains a <asp:textbox that is made visible on some repeater elements. when I come to read the text info out it has...
1
by: olduncleamos | last post by:
Hello all, I am experimenting with the repeater control and ran into something that I wasn't expecting. I would appreciate if the experts can confirm or correct my understanding. Here is a...
3
by: Andrew | last post by:
Hi, I am working on a questionnaire. I have displayed a questionnaire using a repeater control. The itemtemplate is as below (quite cut down): <ItemTemplate> <tr><td> <%#...
3
by: Brian | last post by:
Using external XML, I'm trying to build a quiz, but I can't seem to specify the DataSource for the RadioButtonList within a Repeater ItemTemplate. I've tried a number of approaches, but I haven't...
12
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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:
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...

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.