G
Guest
Hello there,
I am currently in the process of 'getting strict' with some of our aspx.vb
files. I have a function that is called either when a datarepeater is bound
or when a button on the datareader is selected. The function accepts a
'sender' object, which may be of a different type depending on how the
function is ran.
In one instance the type is "System.Web.UI.WebControls.RepeaterItem", and on
others it is "System.Web.UI.HtmlControls.HtmlTableCell". Where i could simply
use sender.FindControl previously, I now have to check the
'sender.GetType.ToString' value and get each of the controls using if
statements based on this so I can cast my sender object to the correct type.
This has worked but I can't help feeling there must be an easier and neater
way of doing this!
If anybody has any suggestions they'd be gratefully received.
Thanks very much,
Carl Howarth
I am currently in the process of 'getting strict' with some of our aspx.vb
files. I have a function that is called either when a datarepeater is bound
or when a button on the datareader is selected. The function accepts a
'sender' object, which may be of a different type depending on how the
function is ran.
In one instance the type is "System.Web.UI.WebControls.RepeaterItem", and on
others it is "System.Web.UI.HtmlControls.HtmlTableCell". Where i could simply
use sender.FindControl previously, I now have to check the
'sender.GetType.ToString' value and get each of the controls using if
statements based on this so I can cast my sender object to the correct type.
This has worked but I can't help feeling there must be an easier and neater
way of doing this!
If anybody has any suggestions they'd be gratefully received.
Thanks very much,
Carl Howarth