Hi IamAzhar,
If you are looking to find id dynamically created textbox so refer below sample will help out.
HTML
<asp:Button Text="Get" runat="server" OnClick="GetId" />
Code
C#
protected void Page_Load(object sender, EventArgs e)
{
for (int i = 0; i < 3; i++)
{
TextBox txt = new TextBox();
txt.ID = "A" + i;
form1.Controls.Add(txt);
}
}
protected void GetId(object sender, EventArgs e)
{
string id = "";
foreach (TextBox textBox in form1.Controls.OfType<TextBox>())
{
id += textBox.ID + ",";
}
ScriptManager.RegisterStartupScript(this, this.GetType(), "", "alert('" + id.Trim(',') + "');", true);
}
VB.Net
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
For i As Integer = 0 To 3 - 1
Dim txt As TextBox = New TextBox()
txt.ID = "A" & i
form1.Controls.Add(txt)
Next
End Sub
Protected Sub GetId(ByVal sender As Object, ByVal e As EventArgs)
Dim id As String = ""
For Each textBox As TextBox In form1.Controls.OfType(Of TextBox)()
id += textBox.ID & ","
Next
ScriptManager.RegisterStartupScript(Me, Me.GetType(), "", "alert('" & id.Trim(","c) & "');", True)
End Sub
Screenshot
![](https://i.imgur.com/K2KL1iP.gif)