I have never needed to modify the Controls in the HeaderTemplate before, but
I think that you would simply do something like:
YourDataListID.FindControl("PreviousPageNav").HRef =String.Format(navigationFormat,
StoreID, pageIndex-1);
The FindControl(ControlID) method returns a reference to the Control with
ControlID, so you can basically use it in place of where you would normally
just use ControlID. But I have never actually tried this with
HeaderTemplates (although I have with the different ItemTemplates, so I
expect it will be the same), so hopefully it will work. Good Luck!
--
Nathan Sokalski
http://www.nathansokalski.com/
"Paul" <> wrote in message
news:K6GLf.5$...
>I have an item in the aspx part of my page:
>
> <a id="PreviousPageNav" runat="server" >
>
> <asp:Image runat=server ID="PreviousImage"
> ImageUrl="~/Images/Nav/previous.gif" />
>
> </a>
>
> that I put in the header of a DataList.
>
> When it was outside of the Datalist, on the Code Behind, I accessed it
> like this:
>
> PreviousPageNav.HRef = String.Format(navigationFormat, StoreID,
> pageIndex - 1);
>
> PreviousPageNav.Visible = (pageIndex > 0) ? true : false;
>
>
>
> But I can not seem to be able to access it once it is in the header of the
> DataList. Looking around, I see the FindControl method, but am usure on
> how to use it.
>
> Suggestions, please?
>
>
>
> Paul
>
>