Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3937954
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T00:07:42+00:00 2026-05-20T00:07:42+00:00

I have a web page where users need to enter customer contact information. They

  • 0

I have a web page where users need to enter customer contact information. They could enter from 0 to an infinite number of contacts.

I created this page code on page:

<ajaxToolkit:ToolkitScriptManager runat="Server" EnablePartialRendering="true" ID="ScriptManager1" />
<asp:PlaceHolder ID="phCustomerContacts" runat="server" EnableViewState="true">/asp:PlaceHolder>
<asp:LinkButton ID="btnAddContact" runat="server" OnClick="btnAddContact_Click" CssClass="LinkButton" Text="Add Contact"/>

In my code behind I added this:

   public void btnAddContact_Click(object sender, EventArgs e)
    {
        IList<CustomerContactProfile> customerContacts = new List<CustomerContactProfile>();
        if (ViewState["CustomerContactList"] != null)
            customerContacts = (List<CustomerContactProfile>)ViewState["CustomerContactList"];
        CustomerContactProfile contactProfile = (CustomerContactProfile)LoadControl("~/Controls/Embedded/CustomerContactProfile.ascx");
        customerContacts.Add(contactProfile);

        foreach (CustomerContactProfile contact in customerContacts)
            phCustomerContacts.Controls.Add(contact);

        ViewState["CustomerContactList"] = customerContacts;
    }

This code doesn’t work because the ViewState can’t handle storing all of that control data. However, I cannot think of another way to store the controls that were already added.

The viewstate of the asp:PlaceHolder control doesn’t save anything and I need the controls to be saved so that if a user puts in some data to the first control that the data isn’t lost when they add a second one and so on.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T00:07:42+00:00Added an answer on May 20, 2026 at 12:07 am

    Rather than store the entire control, simply store the underlying data in session, and rebuild the control set from that data every time you reload the page.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a requirement to allow users to open word document from web page
I have a web page where the user will enter their address. They will
I have a .jsp page that users can enter information and then save it
Background I have a page on my ASP.NET MVC web app for users to
I have an asp.net update web app. Users go the the page, hit the
I have an asp.net web page (C# 2008) where the user would enter an
I have a web page where users upload&watch videos. Last week I asked what
I have three text boxes on my web page to enter simple text messages
I need a solution where a user could enter the URL of a web
I have a web page that uses cross page posting to post to a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.