R
Rod
I've written 2 ASP.NET applications (I've worked on one with a team and
another by myself). In my ASP.NET pages, when saving data to a backend
database I've done it by using the click event of a button and just using
the data during postback.
Now, however, I've got a WebForm that I'll be working on, and it is going to
collect more data than I have collected from the user in the past. I want to
be able to attempt to save each part and if any data element won't be saved,
then go ahead and continue processing the data until all of the entered data
is either saved or failed in the attempt. And then I wanted to inform the
user of the success and failure of trying to save each of the data elements.
Since there is more data now then before, I thought I would have to do what
I've seen done elsewhere on the Web and that is have the user enter all of
their data, press a button and go to some other page in order to save the
data as well as letting the user know the status of their trying to save the
data.
I've read of various ways of solving my problem:
Pass data from one WebForm to another WebForm by:
1) putting the data into the QueryString
2) putting the data into the Session object
3) putting the data the Context object's Items collection
I have also seen an article on MSDN titled "Passing Server Control Values
Between Pages" (
http://msdn.microsoft.com/library/d...conpassingservercontrolvaluesbetweenpages.asp )
..
And I have a book titled, "ASP.NET Unleashed: Second Edition" by Stephen
Walther (published by SAMS; ISBN: 0-672-32542-x) which says, "To take full
advantage of the ASP.NET framework, you should not create HTML forms that
post to a separate page. If a form posts to another page, any view state
maintained by the page is lost. ... The preferred method for working with
forms in the ASP.NET framework is to post forms back to the same page. ...
After you perform a postback, you can use the Response.Redirect method to
send a user a new page." (Appendix A, under the heading "Forms Should Post
Back to the Same Page", pp. 1361-1362.)
OK, now I am REALLY confused! I can accept and appreciate the fact that
there is more than one way to do whatever it is you want to do in ASP.NET.
What I would like to know is, what is the preferred way of handling a large
amount of data that you want to attempt to save and then report back to the
user the status of the attempt of saving. What is the "best practice", if
you will, of doing this?
Rod
another by myself). In my ASP.NET pages, when saving data to a backend
database I've done it by using the click event of a button and just using
the data during postback.
Now, however, I've got a WebForm that I'll be working on, and it is going to
collect more data than I have collected from the user in the past. I want to
be able to attempt to save each part and if any data element won't be saved,
then go ahead and continue processing the data until all of the entered data
is either saved or failed in the attempt. And then I wanted to inform the
user of the success and failure of trying to save each of the data elements.
Since there is more data now then before, I thought I would have to do what
I've seen done elsewhere on the Web and that is have the user enter all of
their data, press a button and go to some other page in order to save the
data as well as letting the user know the status of their trying to save the
data.
I've read of various ways of solving my problem:
Pass data from one WebForm to another WebForm by:
1) putting the data into the QueryString
2) putting the data into the Session object
3) putting the data the Context object's Items collection
I have also seen an article on MSDN titled "Passing Server Control Values
Between Pages" (
http://msdn.microsoft.com/library/d...conpassingservercontrolvaluesbetweenpages.asp )
..
And I have a book titled, "ASP.NET Unleashed: Second Edition" by Stephen
Walther (published by SAMS; ISBN: 0-672-32542-x) which says, "To take full
advantage of the ASP.NET framework, you should not create HTML forms that
post to a separate page. If a form posts to another page, any view state
maintained by the page is lost. ... The preferred method for working with
forms in the ASP.NET framework is to post forms back to the same page. ...
After you perform a postback, you can use the Response.Redirect method to
send a user a new page." (Appendix A, under the heading "Forms Should Post
Back to the Same Page", pp. 1361-1362.)
OK, now I am REALLY confused! I can accept and appreciate the fact that
there is more than one way to do whatever it is you want to do in ASP.NET.
What I would like to know is, what is the preferred way of handling a large
amount of data that you want to attempt to save and then report back to the
user the status of the attempt of saving. What is the "best practice", if
you will, of doing this?
Rod