473,406 Members | 2,698 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,406 software developers and data experts.

Keeping dynamically created data on Postback

Tim
Hello All,

Hope someone can point me in the right direction here.

I have a ASPX page that is being created dynamically. My function adds
Labels and Text Boxes to a Table ready for the user to fill them in.

Once the user has entered their information I need to be able to store it
all in a database. The only problem I have is that by using a Web Button
all the dynamically created controls disapear beacuse of the postback. My
question therfore is what method should I use to capture all this data and
save it to the database. Can I do it all client side? If so wouldn't this
make the page quite insecure as all my SQL will be exposed.

Thanks for any pointers or tips.

Tim
Nov 19 '05 #1
3 2127
Tim,

You need to re-created the controls on postback and they will get they
values from ViewState.

Look at this for the details:
http://msdn.microsoft.com/library/de...mmatically.asp
Eliyahu

"Tim" <ti*******@smoothit.co.uk> wrote in message
news:eI****************@TK2MSFTNGP09.phx.gbl...
Hello All,

Hope someone can point me in the right direction here.

I have a ASPX page that is being created dynamically. My function adds
Labels and Text Boxes to a Table ready for the user to fill them in.

Once the user has entered their information I need to be able to store it
all in a database. The only problem I have is that by using a Web Button
all the dynamically created controls disapear beacuse of the postback. My
question therfore is what method should I use to capture all this data and
save it to the database. Can I do it all client side? If so wouldn't this
make the page quite insecure as all my SQL will be exposed.

Thanks for any pointers or tips.

Tim

Nov 19 '05 #2
Also, you can place then in Denis Bauer's DynamicPlaceHolder control (free):
http://www.denisbauer.com/ASPNETCont...aceholder.aspx

though you should still read the aformentioned article in full.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Eliyahu Goldin" <re*************@monarchmed.com> wrote in message
news:ey**************@TK2MSFTNGP14.phx.gbl...
Tim,

You need to re-created the controls on postback and they will get they
values from ViewState.

Look at this for the details:
http://msdn.microsoft.com/library/de...mmatically.asp
Eliyahu

"Tim" <ti*******@smoothit.co.uk> wrote in message
news:eI****************@TK2MSFTNGP09.phx.gbl...
Hello All,

Hope someone can point me in the right direction here.

I have a ASPX page that is being created dynamically. My function adds
Labels and Text Boxes to a Table ready for the user to fill them in.

Once the user has entered their information I need to be able to store it
all in a database. The only problem I have is that by using a Web Button
all the dynamically created controls disapear beacuse of the postback.
My
question therfore is what method should I use to capture all this data
and
save it to the database. Can I do it all client side? If so wouldn't
this
make the page quite insecure as all my SQL will be exposed.

Thanks for any pointers or tips.

Tim


Nov 19 '05 #3
From the article link below:

Only a developer would know the absolute joy of moving a heavily
database centric desktop application to a web environment. Can you smell
the sarcasm? Aside from storing data in cache, session, or static objects
there is no storage place in memory for us to put data for fast access and
hold onto it until the user closes the application the same way a desktop
application can. Thus, we end up having to run expensive queries to
retrieve meta data (information stored in our database that helps describe
our data) each time the page loads as well as when it posts back to itself.
Wouldn't it be nice to store this information somewhere so we don't
have to run the same query again on page post back? As an added benefit, it
would be nice if we could rebuild the dynamic controls in their entirety
(including colors, fonts, styles, etc...) without requerying the database at
all!
http://www.eggheadcafe.com/articles/...xviewstate.asp

--
Robbe Morris - 2004/2005 Microsoft MVP C#
Free Source Code for ADO.NET Object Mapper To DataBase Tables And Stored
Procedures
http://www.eggheadcafe.com/articles/..._generator.asp


"Tim" <ti*******@smoothit.co.uk> wrote in message
news:eI****************@TK2MSFTNGP09.phx.gbl...
Hello All,

Hope someone can point me in the right direction here.

I have a ASPX page that is being created dynamically. My function adds
Labels and Text Boxes to a Table ready for the user to fill them in.

Once the user has entered their information I need to be able to store it
all in a database. The only problem I have is that by using a Web Button
all the dynamically created controls disapear beacuse of the postback. My
question therfore is what method should I use to capture all this data and
save it to the database. Can I do it all client side? If so wouldn't this
make the page quite insecure as all my SQL will be exposed.

Thanks for any pointers or tips.

Tim

Nov 19 '05 #4

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

Similar topics

4
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...
1
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
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
by: djc | last post by:
On the page_load event I am querying a database and binding data to some text boxes, list boxes, and a repeater control. When the page loads it uses the value of one of the database fields (status)...
1
by: ree32 | last post by:
I have a placeholder and depending on a user input(a drop downlist) when the user clicks a button I dynamically create a number of datagrids and fill them with data from a database. But the problem...
1
by: Marcus | last post by:
I have a problem maybe one of you could help me with. I've created a data entry screen with lots of dynamically-created client-side controls. I create HTML texboxes client-side by assigning a...
0
by: news.zen.co.uk | last post by:
Hi Guys, Using VB .NET 2003 and ASP1.1, I have a Datagrid embedded in an ASP page. In the processing of the ItemDataBound event I dynamically create a new Datagrid control within the Cell of the...
4
by: mohaaron | last post by:
I can think of a lot of reasons why this might need to be done but as far as I can tell it's not possible. I've been looking for a way to add HtmlTableRows to a table using a button click for a...
4
by: Craig Buchanan | last post by:
I dynamically add data-bound templates to a gridview in my ascx control. while this works correctly when the gridview is databound to the datatable, i'm having issues on postback. i would like...
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
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:
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...

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.