Thursday, March 22, 2012

Object reference not set to an instance of an object.

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!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

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
<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.

"Natty Gur" <natty@.dao2com.com> schreef in bericht
news:#FLCVAkZDHA.2520@.TK2MSFTNGP09.phx.gbl...
> 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
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!

0 comments:

Post a Comment