On Nov 18, 10:14*am, "King Coffee" <kcof...@hotmail.com> wrote:
> Hi,
>
> I need help in referencing nested server-side IDs. I have an asp:GridView
> ID="GridView1" control. The columns tag contains an asp:Image ID="Image1"
> control. How can I set the Image1 ImageUrl attribute in the codebehind file
> ?
>
> King
Use RowDataBound event
http://msdn.microsoft.com/en-us/libr...databound.aspx
void CustomersGridView_RowDataBound(Object sender,
GridViewRowEventArgs e)
{
if(e.Row.RowType == DataControlRowType.DataRow)
{
Image img = e.Row.FindControl("Image1") as Image;
img.ImageUrl = "...";
}
}