I have a datalist that stored a button once the button clicked the user is moved to another page, right now i have two problems, from some reason when i press the button the original page DataList2_ItemCreated
is been fired and that's creating errors since the datalist items can not be found, i've overcome that by placing try catch block where i use these items.
the second problem i have is that i can't find the button control in the second page, this is the code i use in the second page:
If PreviousPage.IsPostBack Then
Dim imgBtn As ImageButton = CType(PreviousPage.FindControl("btnAddToCart"), ImageButton)
If Not imgBtn Is Nothing Then