473,513 Members | 2,752 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

add controls dynamically to table

Hi,

I am trying to add controls (textboxes, dropdownlist,...) dynamically
to the table. The problem is when the page is posted back, all of the
controls disappear and the table is reset to empty. I need to be able
to capture the data saved by the user that posted back from these
controls to save to the database. Btw, the enableviewstate is true.

Can someone please help?

The snippet below:

private void Page_Load(object sender, System.EventArgs e)
{
if(!IsPostBack)
{
BindTable();
}
}

private void BindTable()
{
....
}

Thanks
Chad

Nov 19 '05 #1
2 1077
TJS
after a postback the controls need to be recreated or they do not appear
Nov 19 '05 #2
You need to re-create the controls after each postback.
You can save variables into viewstate manually if that helps you keep track
of things.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

"chad" <ho******@yahoo.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Hi,

I am trying to add controls (textboxes, dropdownlist,...) dynamically
to the table. The problem is when the page is posted back, all of the
controls disappear and the table is reset to empty. I need to be able
to capture the data saved by the user that posted back from these
controls to save to the database. Btw, the enableviewstate is true.

Can someone please help?

The snippet below:

private void Page_Load(object sender, System.EventArgs e)
{
if(!IsPostBack)
{
BindTable();
}
}

private void BindTable()
{
...
}

Thanks
Chad

Nov 19 '05 #3

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

Similar topics

3
10773
by: Kiyomi | last post by:
Hello, I create a Table1 dynamically at run time, and at the same time, I would like to create LinkButton controls, also dynamically, and insert them into each line in my Table1. I would...
2
1145
by: Eric | last post by:
I am in need of some advice on how to do the following: Have some type of container on form that would fill the visible area on screen (assuming the browser was maximized). I would like to...
3
2961
by: RSB | last post by:
Hi Every one Having tuff time creating web controls Dynamically. All i am trying to do is read a table and generate a list of ASP TEXT Box. So how do i create this Control dynamically and where...
4
2489
by: Bas Groeneveld | last post by:
I am developing an ASP.NET application part of which consists of a data entry wizard defined by entries in a data table - ie the controls on each page of the wizard are determined by definitions in...
2
12345
by: Michael | last post by:
Need some help trying to read values from web controls - specifically *finding* the controls (like a drop down list) - that are added dynamically added within an asp:panel control. The page...
1
3008
by: Kamal Jeet Singh | last post by:
Hi Friends !! I am have facing problem in controlling the dynamically created controls on web page. The problem Scenario is Scenario:- My requirement is to load the web user controls on the...
1
2556
by: Kamal Jeet Singh | last post by:
Hi Friends !! I am facing problem in controlling the dynamically created controls on web page. The problem Scenario is Scenario:- My requirement is to load the web user controls on the web...
2
2895
by: Chad | last post by:
I have a problem that I am desperate to understand. It involves dynamically adding controls to a Table control that is built as a result of performing a database query. I am not looking to...
1
2049
by: Jeffrey Todd | last post by:
I have successfully created functionality that mostly models what I'm trying to do - which is dynamically insert controls into a user control (ascx), and insert validation controls, also...
5
3713
by: Dennis Fazekas | last post by:
Greetings, I am creating a web form which will all the user to add an unlimited number of email addresses. Basically I have 3 buttons, "Add Another Email", "-" to remove, and a "Save" button....
0
7153
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
7373
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
7432
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...
1
7094
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
7519
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
5677
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
4743
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...
0
3230
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
1585
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 ...

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.