473,749 Members | 2,384 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2141
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*******@smoo thit.co.uk> wrote in message
news:eI******** ********@TK2MSF TNGP09.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 DynamicPlaceHol der 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.co m> wrote in message
news:ey******** ******@TK2MSFTN GP14.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*******@smoo thit.co.uk> wrote in message
news:eI******** ********@TK2MSF TNGP09.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*******@smoo thit.co.uk> wrote in message
news:eI******** ********@TK2MSF TNGP09.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
2498
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 the table. I know that I can dynamically add controls (eg a textbox) to the page controls collection of a web form in a server event which will then be rendered onto the form, as in the following snippet: System.Web.UI.WebControls.TextBox...
1
3021
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 web page dynamically. To do this, First I including a web page (MainPage.aspx) and I made form tag to Runat=Server. I included one table tag and also made this table Runat=Server side. Second I created three Web User Controls e.g....
1
2577
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 page dynamically. To do this, First I including a web page (MainPage.aspx) and I made form tag to Runat=Server. I included one table tag and also made this table Runat=Server side. Second I created three Web User Controls e.g. wucCustomerInfo.ascx,
2
1946
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) to determine what options should be available for this particular item (which is an issue... small issue tracking system). Each of these options is an action that may be performed on the issue and I am dynamically creating LinkButtons for each...
1
2337
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 is that on a postback I lose all the datagrids and their data. I have looked at numerous pages on the net regarding this issue. Many say you have to rebuild build the controls on postback. How am I meant to do this in my situation as I don't...
1
3414
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 value to the td.innerHTML property. The UI is done, and I now want to post back the user's changes and update my business object in .NET. But when I postback, I can't see any of my dynamically created HTML controls in VB .NET. How do I make them...
0
1348
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 Parent (this refelect GUI'wise a Parent Child related data). I also add Handlers to the sub datagrid using AddHandler to handle the EditCommandColumn as well as ItemDataBound. Parent Datagrid...
4
2972
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 while and it seems it's not possible because the row that gets added with each click won't get recreated after a post back. After all the reading it seems that any dynamically created controls must be created in the Init event to be recreated after...
4
11009
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 to iterate thru the gridview's rows, examine the databound controls, then perform a database action. for some reason, i can't find the controls. i have a two templates: one that uses a label the other uses a textbox to display data. when the...
0
9388
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
9333
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
9254
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...
1
6800
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6078
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
4608
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2217
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.