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

DataSource & PostBack

SLE
Hi there,

I am binding a DataTable of a typed DataSet to a DataList control. Two
columns are editable (i.e. Boolean types, implemented with a template column
and CheckBoxes). The user is allowed to change those two columns. A Button
is used to confirm modifications.

Problem is I can't figure out how to save changes. After postback,
DataList.DataSource is Nothing. I can enumerate all controls (CheckBoxes and
their Values) thanks to ViewState but I guess this is not the way to go.

Please point me in the right direction - thanks.
--
SLE
Nov 18 '05 #1
1 2482
Hi,

in which event you're binding the datalist with the datatable. If this is
Page_Load, try it like this: -

if (!IsPostBack)
{
// Perform initial databinding
}
else
{
// don't write anything, let the controls restore their values
// from the Viewstate. Also, set the EnableViewState
// property for the list item true
}

Regards
Joyjit

"SLE" <in**@NOSPAM.dataworx.be> wrote in message
news:eT**************@TK2MSFTNGP11.phx.gbl...
Hi there,

I am binding a DataTable of a typed DataSet to a DataList control. Two
columns are editable (i.e. Boolean types, implemented with a template column and CheckBoxes). The user is allowed to change those two columns. A Button
is used to confirm modifications.

Problem is I can't figure out how to save changes. After postback,
DataList.DataSource is Nothing. I can enumerate all controls (CheckBoxes and their Values) thanks to ViewState but I guess this is not the way to go.

Please point me in the right direction - thanks.
--
SLE

Nov 18 '05 #2

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

Similar topics

3
by: Alvaro E. Gonzalez V. | last post by:
Hello!!! I'm building a control that in a property assign a Dataset which they are initialized and another property Like DataMember. Similar as it happens to the DataSource property of a...
4
by: dm_dal | last post by:
Is there a know issue surrounding the CheckBoxList control and it's viewstate? When my control is created, it's ListItems are checked as needed, but on a postback, they loose their Selected...
6
by: vips | last post by:
Page_Load datagrid1.datasource=dataset1 //I am filling the datagrid and it works fine when page is displayed end ---------------
2
by: Alan Silver | last post by:
Hello, I am using a repeater on a page, and on postback would like to get hold of the ArrayList that I used to populate the repeater. I thought that I should be able to do something like... ...
0
by: JT_74 | last post by:
I'm developing an add-on module for CRM. I was not the person who installed CRM on our server, but I believe it goes along with the problem I'm having. I think it's more of an ASP.NET question then...
4
by: Narshe | last post by:
If I create a datagrid, and set a source and bind it, the data shows up fine. When a postback occurs, the DataGrid.DataSource == null. Is there something in the web.config I'm missing? This is...
6
by: John Smith | last post by:
I have my <asp:TextBox> inside one of DataGrid's columns. I haven't set AutoPostBack=True. When I hit the ENTER button, my page "refreshes" (I belive that PostBack was performed - however not...
0
by: johnnyD | last post by:
I am creating a page which displays a customers billing history. As such it uses a datasource which queries the billing table. This works fine, and outputs desired information I need. I need the...
0
by: 1388-2/HB | last post by:
I have a page with a significant number of dynamically created radio buttons, checkboxes and textboxes. When a user is presented with this form and subsequently fills a bunch of stuff out, when...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
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
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
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,...

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.