
Signature
Alan Silver
(anything added below this line is nothing to do with me)
> Hello,
>
[quoted text clipped - 12 lines]
>
> 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.

Signature
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
Jacek Stawicki - 18 Jul 2005 21:15 GMT
I'm not sure, but I think this index is -1. Just try :)
Another way is to use:
void R1_ItemDataBound(Object Sender, RepeaterItemEventArgs e) {
if (e.Item.ItemType == ListItemType.Header) {
// txtFred = ((TextBox)e.Item.FindControl("txtFred")).Text;
}
}

Signature
C# Dev
> > Hello,
> >
[quoted text clipped - 17 lines]
> think it's 0 like you indicated, but see whats in rptNpVars.Controls[0]
> by stepping into it in the watch window.
Alan Silver - 18 Jul 2005 23:18 GMT
>I'm not sure, but I think this index is -1. Just try :)
OK, I'll give it a go (on my way to bed, so I'm not trying it now!!).
>Another way is to use:
>
[quoted text clipped - 4 lines]
> }
> }
Which is fine inside the event, but what if you want to get at it
outside of that? In truth, I suspect that you wouldn't want it inside
the repeater then, but it's too late for my little brain to think this
through!!
Thanks for the reply.

Signature
Alan Silver
(anything added below this line is nothing to do with me)
Alan Silver - 18 Jul 2005 23:16 GMT
>> 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
[quoted text clipped - 11 lines]
>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.

Signature
Alan Silver
(anything added below this line is nothing to do with me)