Keeping dynamically created data on Postback

T

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
 
R

Robbe Morris [C# MVP]

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/extendtextboxviewstate.asp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,233
Members
46,821
Latest member
AleidaSchi

Latest Threads

Top