Click here to Skip to main content
11,706,007 members (54,039 online)
Click here to Skip to main content
Add your own
alternative version

ViewState in Dynamic Control

, 22 Apr 2009 CPOL 67K 2.6K 28
Maintaining ViewState while working with Dynamic Control
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class UserControl_ContactDetails : System.Web.UI.UserControl
    protected void Page_Load(object sender, EventArgs e)
        //Retain the state of controls
        txtAddress1.Text = Request.Form[txtAddress1.UniqueID];
        txtAddress2.Text = Request.Form[txtAddress2.UniqueID];
        txtCity.Text = Request.Form[txtCity.UniqueID];
        txtFirstName.Text = Request.Form[txtFirstName.UniqueID];
        txtLastName.Text = Request.Form[txtLastName.UniqueID];
        txtZip.Text = Request.Form[txtZip.UniqueID];

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Team Leader Softwebsolutions INC
India India
Profiles : Code Project, ASP.NET Forums

Blog : Knowledgebase

Current Company : Softwebsolution

User Group : Ahmedabad SQLServer UserGroup

Other : Microsoft Certified Technology Specialist (MCTS)

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.150819.1 | Last Updated 22 Apr 2009
Article Copyright 2009 by BhadeliaImran
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid