>> If I have a control in the header template of a repeater, how do I
get at this in code? I know how to do this for an ItemTemplate, you
just do...
txtFred = (TextBox)rptNpVars.Items[i].FindControl("txtFred");
where i is the index of the item. How do I do a similar thing for
the header? Following a post I found in the archives, I tried ...
txtFred = (TextBox)rptNpVars.Controls[0].FindControl("txtFred");
but this gave an error "Specified argument was out of the range of
valid values. Parameter name: index".
Thanks for any help.
Have you tried the QuickWatch window on rptNpVars.Controls and seeing
what's in it? I dont know the index for the header template but I would
think it's 0 like you indicated, but see whats in rptNpVars.Controls[0]
by stepping into it in the watch window.
I'm not using VS, so I can't do this. I'm fairly new at ASP.NET and
didn't fancy spending all that money on VS 2003, when it's about to be
superseded by an apparently superior product.
Also, I find I learn what's going on a lot better by doing it all by
hand. I get to see what is needed first hand, rather than having an IDE
make changes without me knowing. I think I've learnt a lot more this way
than I would have with VS.
Thanks anyway.
--
Alan Silver
(anything added below this line is nothing to do with me)