473,795 Members | 2,391 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Post Backs and dynamically created tables

Hi all

I am building a page dynamically on Page_Load. using Table web controls for
this.
the web page builds up and loads up and displays ok. but as soon as there is
a post back of any sort, all my dynamic building is gone. the page reverts
back to it's "original" design time state.

i have a OK button, that when the user clicks on this button, it will go and
get data from the dynamically built page. but obviously i cant do that,
because the dynamically built page is now gone, due to the post back.

how do i get around this?

Thanks
Jason
Nov 19 '05 #1
5 1301
Is your table being loaded within an if block that tests for post back?

ex:
if(!IsPostBack)
LoadMyTable();

If this is the case, you should remove that code from the if block.
--

Thanks,

Jeremy Ames
Code Powered Technologies
"Jason" <c_*******@migh ty.co.za> wrote in message
news:ex******** *****@TK2MSFTNG P11.phx.gbl...
Hi all

I am building a page dynamically on Page_Load. using Table web controls
for
this.
the web page builds up and loads up and displays ok. but as soon as there
is
a post back of any sort, all my dynamic building is gone. the page reverts
back to it's "original" design time state.

i have a OK button, that when the user clicks on this button, it will go
and
get data from the dynamically built page. but obviously i cant do that,
because the dynamically built page is now gone, due to the post back.

how do i get around this?

Thanks
Jason

Nov 19 '05 #2
but then the table and all it's contents will be recreated, therefore the
user input is lost. right?

"Jeremy Ames" <je****@code-tech.net> wrote in message
news:OR******** ********@TK2MSF TNGP15.phx.gbl. ..
Is your table being loaded within an if block that tests for post back?

ex:
if(!IsPostBack)
LoadMyTable();

If this is the case, you should remove that code from the if block.
--

Thanks,

Jeremy Ames
Code Powered Technologies
"Jason" <c_*******@migh ty.co.za> wrote in message
news:ex******** *****@TK2MSFTNG P11.phx.gbl...
Hi all

I am building a page dynamically on Page_Load. using Table web controls
for
this.
the web page builds up and loads up and displays ok. but as soon as there is
a post back of any sort, all my dynamic building is gone. the page reverts back to it's "original" design time state.

i have a OK button, that when the user clicks on this button, it will go
and
get data from the dynamically built page. but obviously i cant do that,
because the dynamically built page is now gone, due to the post back.

how do i get around this?

Thanks
Jason


Nov 19 '05 #3
You should do it in Page_Init. That way, user data can be restored.

"Jason" wrote:
but then the table and all it's contents will be recreated, therefore the
user input is lost. right?

"Jeremy Ames" <je****@code-tech.net> wrote in message
news:OR******** ********@TK2MSF TNGP15.phx.gbl. ..
Is your table being loaded within an if block that tests for post back?

ex:
if(!IsPostBack)
LoadMyTable();

If this is the case, you should remove that code from the if block.
--

Thanks,

Jeremy Ames
Code Powered Technologies
"Jason" <c_*******@migh ty.co.za> wrote in message
news:ex******** *****@TK2MSFTNG P11.phx.gbl...
Hi all

I am building a page dynamically on Page_Load. using Table web controls
for
this.
the web page builds up and loads up and displays ok. but as soon as there is
a post back of any sort, all my dynamic building is gone. the page reverts back to it's "original" design time state.

i have a OK button, that when the user clicks on this button, it will go
and
get data from the dynamically built page. but obviously i cant do that,
because the dynamically built page is now gone, due to the post back.

how do i get around this?

Thanks
Jason



Nov 19 '05 #4
Jason < c_*******@might y.co.za > wrote:
but then the table and all it's contents will be recreated, therefore the
user input is lost. right?

For dynamic controls, if you create the controls with the same ID on each
page request, ASP.NET will repopulate their values with Postback data. Load
is a little bit late, technically, to do this, but it should still work as
the controls will play "catch-up".
Nov 19 '05 #5
> but then the table and all it's contents will be recreated, therefore the
user input is lost. right?


No, that was checking for NOT postback. Ie, that will cause the table to be
built on page_load the first time the page is loaded, but not on postback.
It sounds like you are building the table on both the first page load and on
the postback right now.

-Darrel
Nov 19 '05 #6

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

Similar topics

0
8685
by: Chris Powell | last post by:
I am using Excel/Access 2000 and have two large Excel files (25,000 rows each) that I wish to create linked tables in Access rather than importing into Access. The two source Excel files change frequently, so I want to: A) prompt the user, using a custom form, for the specific Excel files to be linked; B) create the links dynamically; C) insert the linked tables into a select query grid and include the SQL statement in the VBA...
0
1375
by: Syoam4ka | last post by:
My project is about jewellery. I have devided my jewelery into main types, which each one of them has sub types, and each one those sub types has the jewellery. I have a tabcontainer. It includes tabpanels such as:Catalog,Terms,SiteMap.ViewCart ,etc. All the jewellery Intro is in the Catalog panel. when I first click the Catalog panel it Introduces me all the main types of the jewellery(It's all done dynamically from the cs file).The...
2
6535
by: ssmith147 | last post by:
Hi, I'm somewhat familiar with access and vb programming (I can read someone else's code, for the most part), but I'm still very green when it comes to creating solutions for my own needs. I'm trying to create a db for a friend's business. I have two issues that I'm wrestling with. First is how to dynamically create a text box on a form. I'm building a form that relates information between two tables (A, B). Table B is the source of...
1
4915
by: semomaniz | last post by:
I have a form where i have created the form dynamically. First i manually added a panel control to the web page. Then i added another panel dynamically and inside this panel i created tables. I have set text boxes and labels inside the table rows. I then added a button. All of these are done through code. The problem that i am having is i can get the value from a text box with resides inside the first panel (out side of panel that is...
0
9672
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9519
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10438
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10214
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10164
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10001
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6780
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3727
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.