Last post Feb 26, 2009 11:20 AM by jnc
Feb 25, 2009 12:14 PM|jnc|LINK
I have an ascx control which I use for login so it collects data relating to the user, It also displays a list of Applications(web pages) that user has signed up for. The user then clicks the application name in the list to load the next page
I want to pass the collected data from the ascx to the next page,
I have some public properties in Viewstate in the ascx which I can access from the parent but they always appear to be null and the next page looks to the parent for the data
any help please?
Feb 25, 2009 03:45 PM|che3358|LINK
Viewstate is page scope. Therefore, when you switch pages, the Viewstate is gone. Use Session instead.
Actually, you better use GET Property to let the other pages to get data from your UserControl. For example, you have a TextBox with Id "txtUserName", then, you can do:
private string userName;
public string UserName
In any page where you use the UserControl, you just to
string user = YourUserControlId.UserName;
Hope it helps.
Feb 26, 2009 11:20 AM|jnc|LINK