J
Johnny Luner
I have a control on my page, but I don't know how to CAST it so that I can
access the properties dynamically using FindControl... help. Is it
possible?? since control is not a real class. If not, any solutions
suggestion? Here is the code:
<%@ Register TagPrefix="company" tagname="items" src="items.ascx"%>
<script language="c#" runat="server">
void Page_load(Object sender, EventArgs e) {
// This one works
item_1.name = "test";
item_2.name = "test";
// I don't know how to get it working
for (int i=0; i<=2; i++) {
((??HOW TO CAST??) FindControl("item_" + i)).name = "test";
}
}
</script>
<company:items id="item_1" runat="server" />
<company:items id="item_2" runat="server" />
access the properties dynamically using FindControl... help. Is it
possible?? since control is not a real class. If not, any solutions
suggestion? Here is the code:
<%@ Register TagPrefix="company" tagname="items" src="items.ascx"%>
<script language="c#" runat="server">
void Page_load(Object sender, EventArgs e) {
// This one works
item_1.name = "test";
item_2.name = "test";
// I don't know how to get it working
for (int i=0; i<=2; i++) {
((??HOW TO CAST??) FindControl("item_" + i)).name = "test";
}
}
</script>
<company:items id="item_1" runat="server" />
<company:items id="item_2" runat="server" />