.NETGURU
Templates
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngbeta' list.


Baden Wehmeyer
Hi all,
When I create a template using Page.LoadTemplate(...) I get the
following error
Compiler Error Message: BC30456: The name 'DataItem' is not a member of
'System.Web.UI.Control'.
Source Error:
Line 1: <%# DataBinder.Eval(Container.DataItem, "Key") %> is 
Line 2: <%# DataBinder.Eval(Container.DataItem, "Value") %>
So what is the directive for the acx file I load as a template? This is
not it:
Line 1: <%@ Control language=3D"c#"
Inherits=3D"System.Web.UI.WebControls.RepeaterItem" %>=20
tia
baden

Reply to this message...
 
    
Stuart C. Salsbury
You might try casting your Container as a WebControl, assuming that it is
one.

eg.

<%# DataBinder.Eval(((WebControl)Container).DataItem, "Key")>

Regards,
Stuart Salsbury
Ernst & Young LLP

-----Original Message-----
From: Baden Wehmeyer
To: aspngbeta
Sent: 5/15/2001 11:19 AM
Subject: [aspngbeta] Templates
Importance: High

Hi all,
When I create a template using Page.LoadTemplate(...) I get the
following error
Compiler Error Message: BC30456: The name 'DataItem' is not a member of
'System.Web.UI.Control'.
Source Error:
Line 1: <%# DataBinder.Eval(Container.DataItem, "Key") %> is 
Line 2: <%# DataBinder.Eval(Container.DataItem, "Value") %>
So what is the directive for the acx file I load as a template? This is
not it:
Line 1: <%@ Control language="c#"
Inherits="System.Web.UI.WebControls.RepeaterItem" %>
tia
baden

Reply to this message...
 
    
Baden Wehmeyer
Thanks Stuart,

Yes I had to cast it to RepeaterItem, and I'm smiling again.

-----Original Message-----
From: Stuart C. Salsbury [mailto:Click here to reveal e-mail address]
Sent: 15 May 2001 05:49
To: aspngbeta
Subject: [aspngbeta] Re: Templates

You might try casting your Container as a WebControl, assuming that it
is
one.

eg.

<%# DataBinder.Eval(((WebControl)Container).DataItem, "Key")>

Regards,
Stuart Salsbury
Ernst & Young LLP

-----Original Message-----
From: Baden Wehmeyer
To: aspngbeta
Sent: 5/15/2001 11:19 AM
Subject: [aspngbeta] Templates
Importance: High

Hi all,
When I create a template using Page.LoadTemplate(...) I get the
following error
Compiler Error Message: BC30456: The name 'DataItem' is not a member of
'System.Web.UI.Control'.
Source Error:
Line 1: <%# DataBinder.Eval(Container.DataItem, "Key") %> is 
Line 2: <%# DataBinder.Eval(Container.DataItem, "Value") %>
So what is the directive for the acx file I load as a template? This is
not it:
Line 1: <%@ Control language=3D"c#"
Inherits=3D"System.Web.UI.WebControls.RepeaterItem" %>=20
tia
baden

| [aspngbeta] member Click here to reveal e-mail address =3D YOUR ID
| http://www.asplists.com/asplists/aspngbeta.asp =3D JOIN/QUIT

Reply to this message...
 
 
System.ComponentModel.Container
System.Web.UI.Control
System.Web.UI.DataBinder
System.Web.UI.Page
System.Web.UI.WebControls.RepeaterItem
System.Web.UI.WebControls.WebControl




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification