Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Referencing nested server-side IDs

Reply
Thread Tools

Referencing nested server-side IDs

 
 
King Coffee
Guest
Posts: n/a
 
      11-18-2009
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

 
Reply With Quote
 
 
 
 
Alexey Smirnov
Guest
Posts: n/a
 
      11-18-2009
On Nov 18, 10:14*am, "King Coffee" <(E-Mail Removed)> 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 = "...";
}

}
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Referencing cells in a nested gridview Indo77 ASP .Net 0 10-08-2007 08:53 AM
getting element IDs from nested standard forms in JavaScript =?Utf-8?B?QW1yaXQgS29obGk=?= ASP .Net 8 01-26-2007 09:18 AM
Referencing Nested Formview inside an Empty Data Template SK101 ASP .Net 0 10-11-2006 12:32 PM
OnEditCommand : Nested DataGrid referencing : Code included Chris ASP .Net 0 01-24-2006 06:14 PM
after transfer of data from MS-outlook(mail ids) to application,mail ids are consisting of strange characters vamsikrishna_b@coolgoose.com Python 2 06-21-2005 12:41 PM



Advertisments