This is the code of my user control.
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="NewUserControl.ascx.cs"
Inherits="usercontrol.NewUserControl" %>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:LinkButton ID="LinkButton1" runat="server" onclick="LinkButton1_Click">LinkButton1</asp:LinkButton>
and on another form on the button click event i am loaoding the user control.like this-
protected void LoadControl_Click(object sender, EventArgs e)
{
newuc = LoadControl("NewUserControl.ascx") as NewUserControl;
form1.Controls.Add(newuc);
Session["chksession"] = ((int)Session["chksession"]) + 1;
if (((int)Session["chksession"]) >= 1)
{
for (int i = 1; i < ((int)Session["chksession"]); i++)
{
newuc = LoadControl("NewUserControl.ascx") as NewUserControl;
form1.Controls.Add(newuc);
}
}
}
now user control can be loaded any no of times, now i need the text of all the textboxes present on the form on the click of a Button that is present on the .aspx page. i am new to asp...need guidance.