I have a ASP.Net create user wizard. One of the additional steps I included is to gather contact information for connections the customer may have to fellow co-workers so the account being configured can batch create logins for them as well. The user I use for ContactPerson consist of several text boxes for key info (Name, DoB, Company Name, Address and State).
I use a simple button to invoke the AddContacts method which creates the proper nesting structure used for RadPanelItems. As soon as I add the first item it works fine, the second one though wipes out the first via postback and lack of data persistence.
This user control maps to an EF4 Entity, specifically the page has a member called List ContactList. I wanted to ask what would be the best way for me to persist my Entity data I gathered from the previous contact along with re-adding my user control (with said data) back to the form when a post back is encountered?
I am open to suggestions and I am looking for a best practice solution(s). Thanks in advance.
Until you persist you data, you can use the HttpContext.Current.Session object to store this info. The Session (stored on the server) is better for larger data, the ViewState (stored in a hidden field on the page) can be used for smaller data as it is sent back and forth every request and quickly blows up the page size. For discussion see ViewState Vs Session … maintaining object through page lifecycle or http://msdn.microsoft.com/en-us/library/ms972976.aspx
Annother option (not a good one for your situation) is QueryParameters for very small data like IDs or primary Keys having the advantage that you can copy paste the url to an email and still have the info. see http://www.codeproject.com/Articles/5876/Passing-variables-between-pages-using-QueryString
So back to your issue: For every new contact you add, perform something like this until you finally persist your data.