Object reference not set to an instance of an object.

A

Arjen

Hello,

Here is the error message:
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set
to an instance of an object. (Line 175)

Source Error:

Line 172: private void myDataGrid_ItemDataBound(object sender,
System.Web.UI.WebControls.DataGridItemEventArgs e) {
Line 173: DataRowView drv = (DataRowView) e.Item.DataItem;
Line 174: System.Web.UI.WebControls.Image thumb =
(System.Web.UI.WebControls.Image) e.Item.FindControl("thumbnail");
Line 175: thumb.Attributes.Add("OnClick", "window.close()");

Can somebody help me?

Thanks!
 
N

Natty Gur

Hi,

check that you get Image with "thumbnail" name.

Natty Gur, CTO
Dao2Com Ltd.
34th Elkalay st. Raanana
Israel , 43000
Phone Numbers:
Office: +972-(0)9-7740261
Fax: +972-(0)9-7740261
Mobile: +972-(0)58-888377
 
A

Arjen

<asp:TemplateColumn>
<HeaderStyle CssClass="NormalBold"></HeaderStyle>
<ItemTemplate>
<asp:Image id="thumbnail" name="thumbnail" ImageUrl="<%=
GetBrowsePath((int) DataBinder.Eval(Container.DataItem,'itemId')) %>"
BorderWidth="0" Height="70" Width="100" Runat="server" />
</ItemTemplate>
</asp:TemplateColumn>


It still doesn't works.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top