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

textbox inside a repeater control

Hi,

I have a forrm with viewstate disabled (to try and optimize network
performance). I have come a bit unstuck though when I use a repeater with a
textbox inside it

Obivously with viewstate disabled, the repeater contains no items on
postback unless I databind it. however, this causes the posted textbox
values to be overwritten with the databound ones.

is there any way to do the databind before the posted values are applied, or
do I have to enable viewstate for this form after all?

TIA

Andy
Jan 26 '06 #1
2 4215
Hi Andy,
u should enable viewstate of your repeater. If viewstate is not enabled for
a control it will be re-constructed. that will cause to lose its state as u
have experienced. Enabling only repeater's viewstate is enough for your
case.

--
HTH

Thanks,
Yunus Emre ALPÖZEN
BSc, MCSD.NET
Microsoft .NET & Security MVP

"Andy Fish" <aj****@blueyonder.co.uk> wrote in message
news:eE**************@TK2MSFTNGP14.phx.gbl...
Hi,

I have a forrm with viewstate disabled (to try and optimize network
performance). I have come a bit unstuck though when I use a repeater with
a textbox inside it

Obivously with viewstate disabled, the repeater contains no items on
postback unless I databind it. however, this causes the posted textbox
values to be overwritten with the databound ones.

is there any way to do the databind before the posted values are applied,
or do I have to enable viewstate for this form after all?

TIA

Andy

Jan 26 '06 #2
Hi Andy,

You can have a Page level Arraylist (or Hashtable) for storing values from
textboxes in the repeater. When postback retrieve values first, the rebind
the repeater:

if(IsPostBack)
{
list = new ArrayList();
foreach (RepeaterItem item in repeaterObj.Items)
{
TextBox txt = item.FindControl(txt_ID) as TextBox;
list.Add(txt);
}
}

repeaterObj.DataSource = dataObject;
repeaterObj.DataBind();
HTH

Elton Wang

"Andy Fish" wrote:
Hi,

I have a forrm with viewstate disabled (to try and optimize network
performance). I have come a bit unstuck though when I use a repeater with a
textbox inside it

Obivously with viewstate disabled, the repeater contains no items on
postback unless I databind it. however, this causes the posted textbox
values to be overwritten with the databound ones.

is there any way to do the databind before the posted values are applied, or
do I have to enable viewstate for this form after all?

TIA

Andy

Jan 27 '06 #3

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

Similar topics

4
by: Andy | last post by:
I am attempting to print out a table using a repeater in which one field is updatable. Basically you would have a table of x number of rows and y number of columns. However: only one field in...
3
by: Kelly Leahy | last post by:
I'm using an Asp:Repeater control with a text box in the item templates. This is for a system that has a number of items that the user can edit and I'd like to generate them based on a list. ...
1
by: Bryan | last post by:
I trying to figure out out to validate a textbox inside a repeater once a person presses a button on a repeater. Here's the validation Code behind: Please be aware that line e.Item.ItemIndex...
3
by: Leigh Webber | last post by:
I have an HTMLAnchor control on my aspx page. When it's not inside a repeater, it works fine. When I put it inside a repeater control, the handler never gets fired. I have a handler for the...
1
by: guoqi zheng | last post by:
Dear sir, I have a textbox inside a repeart control, autopostback set to true for that textbox. When the value of this textbox changes, I need to access current row and update database. ...
4
by: Dave | last post by:
Well... with data in the textbox.. This did not work... <asp:TableCell ID="Tablecell1" CssClass="lnk_results" Runat="server" Width="35%" HorizontalAlign="Left" ColumnSpan="5"> <asp:TextBox...
0
by: datakix | last post by:
After 16 hours of frustration, I've managed to solve this problem for a project I'm working on. The 'trick' is set EnableViewState="False" for the asp:textbox inside the Repeater control. The...
8
by: fernandezr | last post by:
I would like to use a user control as a template inside a repeater. Some of the fields in the control should be hidden depending on whether or not there is data. I'm still a ASP .Net newbie so the...
2
by: Dot Net Work | last post by:
I have a user control that contains a textbox and a link button. This UC sits inside a repeater control. When I click any button, any edited textbox value does not get sent back to the server...
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
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...
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)...
0
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...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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.