I need to pass a value from the onload event of a user control to the onload event of the parent page. I have found this code on stackoverflow but I can’t seem to get it to work/adapt it:
Public Property SomeValue() As String
Get
Return textbox1.Text
End Get
End Property
The value I need to pass is a single int from a database.
conn.Open();
reader = comm.ExecuteReader();
if (reader.Read())
{
shoppingCartHeadID = Convert.ToInt32(reader["shoppingCartHeadID"]);
hfShoppingCartHeadID.Value = shoppingCartHeadID.ToString();
}
reader.Close();
In the end I opted to create a separate public class to call and control the cart. This turned out to be much more efficient and cleaner code!
Thank you for your suggestions.