Hey All,
I'm having trouble when removing a dynamically created control, cause, on page_load i'm creating a new controller so the control.count is not counting correctly.
Any ideas how to fix that shitty problem, I'd appreciate any help!!!
Here's the code for removing a controller:
protected void btnRemoveRow_Click(object sender, EventArgs e)
{
if (pnlStaffRows.Controls.Count == 1)
{
litErrorMessage.Text = "<span class='failed'>Det går ej att ta bort första raden</span>";
litErrorMessage.Visible = true;
}
else
{
pnlStaffRows.Controls.RemoveAt(pnlStaffRows.Controls.Count - 1);
}
}
And if anyone is interested here's the whole code:
http://pastebin.com/GeWBTTtD< ...
Go to the complete details ...