By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,899 Members | 1,066 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,899 IT Pros & Developers. It's quick & easy.

Keeping dynamically created data on Postback

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.