Hi
You are assign the current txt value to the alert in a static way. Javascript run at client side. So change your code to
btn.Attributes.Add("onclick", "alert(document.getElementById('" + txt.ClientID + "').value); return false;");
to get the value dynamically
To get the values of the ModelTxt box entered in the pop can be get in the code behind on the submit event. Once press the submit button (add a asp:button control to the aspx and in its click event)...have this code
protected void Button1_Click(object sender, EventArgs e)
{
Control ctrl=null;
foreach (DataListItem Item in DataList1.Items)
{
ctrl = Item.FindControl("ModelTxt");
if (ctrl !=null)
{
TextBox text1 = (TextBox)ctrl;
string txt_entered_in_popup = text1.Text;
}
}
}