473,414 Members | 1,677 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,414 software developers and data experts.

will checkboxes lose their state after postback?

Hi

I have build a datalist with checkboxes in it and after a postback the state
of the checkboxes have not been saved. I have enabled the viewstate of all
the controls on this page. What do I have to implement to keep the state?

ch Jimmy
Nov 19 '05 #1
3 3249
Are these checkboxes bound to a data source? If so, have you updated the
data source in the postback and re-bound the datalist to the data source?
"Jimmy" <be****@gmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi

I have build a datalist with checkboxes in it and after a postback the
state
of the checkboxes have not been saved. I have enabled the viewstate of all
the controls on this page. What do I have to implement to keep the state?

ch Jimmy

Nov 19 '05 #2
Scott
They are not bound to a datasource...
In this case the viewstate does not take care of this? So I have to write
code to put the values of the (un)checked boxes back?

Ch Jimmy
"Scott M." <s-***@nospam.nospam> wrote in message
news:Ob*************@TK2MSFTNGP10.phx.gbl...
Are these checkboxes bound to a data source? If so, have you updated the
data source in the postback and re-bound the datalist to the data source?
"Jimmy" <be****@gmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi

I have build a datalist with checkboxes in it and after a postback the
state
of the checkboxes have not been saved. I have enabled the viewstate of all the controls on this page. What do I have to implement to keep the state?
ch Jimmy


Nov 19 '05 #3
Yes, you seems to have to override the SaveViewstate and LoadViewstate
method in order to reload the value.

..NET framwork will not take care of them because to the framwork, they are
essentially something recreated(i.e.: they are not the origional checkboxes
after postback, they're just another group of checkboxes that process the
same ID as the destroyed ones)

"Jimmy" <be****@gmail.com> ¼¶¼g©ó¶l¥ó·s»D:OB**************@TK2MSFTNGP12.phx.g bl...
Scott
They are not bound to a datasource...
In this case the viewstate does not take care of this? So I have to write
code to put the values of the (un)checked boxes back?

Ch Jimmy
"Scott M." <s-***@nospam.nospam> wrote in message
news:Ob*************@TK2MSFTNGP10.phx.gbl...
Are these checkboxes bound to a data source? If so, have you updated the
data source in the postback and re-bound the datalist to the data source?
"Jimmy" <be****@gmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
> Hi
>
> I have build a datalist with checkboxes in it and after a postback the
> state
> of the checkboxes have not been saved. I have enabled the viewstate of all > the controls on this page. What do I have to implement to keep the state? >
> ch Jimmy
>
>



Nov 19 '05 #4

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

Similar topics

6
by: terence.parker | last post by:
I currently have the following JS in my header: function checkall(thestate) { var checkboxes=eval("document.forms.EssayList.file_id") for (i=0;i<checkboxes.length;i++)...
2
by: Glenn Owens | last post by:
Can someone please explain the rationale behind not putting a checkbox reference into the postback data collection? I have a composite control (supporting IPostBackDataHandler) which populates a...
7
by: DJ Dev | last post by:
Hi All, I have a complex problem. I have dropdownlists (usually 3-5) and the user selects some value from these and for each value selected, datagrids are shown to the user. I am creating the...
4
by: epigram | last post by:
I've got a page that has a Panel object that I am dynamically adding CheckBox controls to. The number of CheckBox controls and the name of each control is based on a database query. I would like...
4
by: Jim Bancroft | last post by:
Hi everyone, I'm using a DataGrid with TemplateColumns. My DataGrid is located in a cell of an asp:Table. I did this so it's positioned correctly onscreen. One of the DataGrid's...
2
by: Tomas Martinez | last post by:
Hi, Well, my problem is so simple as it says in the subjet but very frustrating also. I have a project and it is losing the session variables with each postback, so I downloaded from the web a...
8
by: mark.norgate | last post by:
I've asked this question before, but still haven't solved it, so am asking again. I am programmatically adding a user control to the page in response to a button click. The user control consists...
6
by: arun.hallan | last post by:
Hi, I have a datagrid whose datasource is a datatable which is saved to viewstate on page_load. I also have a cached string which handles what is shown on the rowfilter of the dataview of...
1
by: colin | last post by:
Hi, I have a simple treeview, I want to put tri state checkboxes. I thought this would be standard, TreeViewNode has checkboxes, and checkboxes have tri state, but the TreeViewNode checkbox...
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: 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
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,...
0
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
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...

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.