473,395 Members | 1,460 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.

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 1287
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_*******@mighty.co.za> wrote in message
news:ex*************@TK2MSFTNGP11.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****************@TK2MSFTNGP15.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_*******@mighty.co.za> wrote in message
news:ex*************@TK2MSFTNGP11.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****************@TK2MSFTNGP15.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_*******@mighty.co.za> wrote in message
news:ex*************@TK2MSFTNGP11.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_*******@mighty.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
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...
0
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...
2
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...
1
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...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: 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
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,...
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
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...

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.