473,739 Members | 9,109 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Compiler Error BC30456: 'DataItem' is not a member of 'System.Web.UI. Control' ?

How do I bind an array, arrayList or even a stack to a repeater
containing hyperlinks.

The data structure (array, arrayList or even a stack) has dates
in ISO format "YYYY-MM-DD". The repeated hyperlinks will be
displayed, for example, in this form:

<a href='default.a spx?arc=2004-06-29'>2004-06-29</a>

or, better:

<a href='default.a spx?arc=2004-06-29'>June 29, 2004</a>

------ ------ ------ ------ ------
I get an error:
------ ------ ------ ------ ------

Compiler Error Message: BC30456: 'DataItem' is not a member of
'System.Web.UI. Control'.

for this line:

Text='<%# Databinder.Eval ((Container).Da taItem) %>'

This is the Detailed Compiler Output:

target.Text = System.Convert. ToString(Contai ner.DataItem[0])

PS 1: This page is made up of many controls and this is just one
of them. Some of the others already have Page_Load events.

PS 2: I've tried to change the line but each of the following
give the same error on the same line.

Text='<%# Container.DataI tem %>'
Text='<%# Container.DataI tem[0] %>'
Text='<%# (Container.Data Item)[0] %>'
Text='<%# Container.DataI tem("Value") %>'
Text='<%# DataBinder.Eval ( Container.DataI tem[0] ) %>'
Text='<%# DataBinder.Eval ( Container.DataI tem("Value") ) %>'
Text='<%# DataBinder.Eval ( Container.DataI tem, "Value" ) %>'

PS 3: To make it easy for you I expect the ArrayList to look
something like this:

{"2004-05-19", "2004-06-29" }
------ ------ ------ ------ ------
Here is my control containing the code.
------ ------ ------ ------ ------

<%@ Import Namespace="Syst em.IO" %>
<Script Runat="Server">

Const vbARCHIVE_FILEN AME =
"2004_99_99 _net-example_archive .xml"
Const vbPOST_BACK_FIL E = "default.as px"

Sub Page_Load(vbARC HIVE_FILENAME As String)

Dim aryFileNames As Array
Dim aryDates As ArrayList

Dim lenARCHIVE As Integer
Dim i As Integer
Dim fileName As String
Dim xmlFilePath As String
Dim strISODate As String

lenARCHIVE = Len(vbARCHIVE_F ILENAME) - Len("2004-99-99")

xmlFilePath = Server.MapPath( "blogs/blog.xml" )
aryFileNames = Directory.GetFi les( Left(xmlFilePat h,
Len(xmlFilePath )-8) )

For Each fileName in aryFileNames
If LCase(Right(fil eName, lenARCHIVE)) =
Right(vbARCHIVE _FILENAME, lenARCHIVE) Then
aryDates.Add( Replace (Left(fileName, 10),"_", "-" ) )
End If
Next

rptRHS_Menu.Dat aSource = aryDates
rptRHS_Menu.Dat aBind()
End Sub

</Script>

<!-- Sidebar (RHS Menu) -->
<h6 title="older blogs">archives </h6>
<img src="images/pixel_gr.gif" height="2" width="130"><br />

<asp:Repeater
ID="rptRHS_Menu "
Runat="Server" />
<ItemTemplate >
<ASP:HyperLin k
ID="lnkItem"
Text='<%# Container.DataI tem[0] %>'
NavigateUrl='<% # string.Concat(v bPOST_BACK_FILE ,
"?arc=", Container.DataI tem[0] %>'
Runat="Server" />
</ItemTemplate>
</asp:Repeater>
<!-- END RHS Menu -->

Nov 18 '05 #1
1 5584
The error is due to an incorrectly closed <asp:Repeater > tag.

This tag is closed twice:

<asp:Repeater
ID="rptRHS_Menu "
Runat="Server" />

because it also has close tag </asp:Repeater> below it.

This should replace the corresponding block below:

<asp:Repeater
ID="rptRHS_Menu "
Runat="Server">
<ItemTemplate >
<ASP:HyperLin k
ID="lnkItem"
Text='<%# Container.DataI tem %>'
NavigateUrl='<% # string.Concat(v bPOST_BACK_FILE ,
"?arc=", Container.DataI tem %>'
Runat="Server" />
</ItemTemplate>
</asp:Repeater>

And a line added in Page_Load below the variable declarations:

aryDates = New ArrayList
On Wed, 30 Jun 2004 13:38:14 +0100, Zenobia
<6.**********@s pamgourmet.com> wrote:
How do I bind an array, arrayList or even a stack to a repeater
containing hyperlinks.

The data structure (array, arrayList or even a stack) has dates
in ISO format "YYYY-MM-DD". The repeated hyperlinks will be
displayed, for example, in this form:

<a href='default.a spx?arc=2004-06-29'>2004-06-29</a>

or, better:

<a href='default.a spx?arc=2004-06-29'>June 29, 2004</a>

------ ------ ------ ------ ------
I get an error:
------ ------ ------ ------ ------

Compiler Error Message: BC30456: 'DataItem' is not a member of
'System.Web.UI .Control'.

for this line:

Text='<%# Databinder.Eval ((Container).Da taItem) %>'

This is the Detailed Compiler Output:

target.Text = System.Convert. ToString(Contai ner.DataItem[0])

PS 1: This page is made up of many controls and this is just one
of them. Some of the others already have Page_Load events.

PS 2: I've tried to change the line but each of the following
give the same error on the same line.

Text='<%# Container.DataI tem %>'
Text='<%# Container.DataI tem[0] %>'
Text='<%# (Container.Data Item)[0] %>'
Text='<%# Container.DataI tem("Value") %>'
Text='<%# DataBinder.Eval ( Container.DataI tem[0] ) %>'
Text='<%# DataBinder.Eval ( Container.DataI tem("Value") ) %>'
Text='<%# DataBinder.Eval ( Container.DataI tem, "Value" ) %>'

PS 3: To make it easy for you I expect the ArrayList to look
something like this:

{"2004-05-19", "2004-06-29" }
------ ------ ------ ------ ------
Here is my control containing the code.
------ ------ ------ ------ ------

<%@ Import Namespace="Syst em.IO" %>
<Script Runat="Server">

Const vbARCHIVE_FILEN AME =
"2004_99_99_ne t-example_archive .xml"
Const vbPOST_BACK_FIL E = "default.as px"

Sub Page_Load(vbARC HIVE_FILENAME As String)

Dim aryFileNames As Array
Dim aryDates As ArrayList

Dim lenARCHIVE As Integer
Dim i As Integer
Dim fileName As String
Dim xmlFilePath As String
Dim strISODate As String

lenARCHIVE = Len(vbARCHIVE_F ILENAME) - Len("2004-99-99")

xmlFilePath = Server.MapPath( "blogs/blog.xml" )
aryFileNames = Directory.GetFi les( Left(xmlFilePat h,
Len(xmlFilePat h)-8) )

For Each fileName in aryFileNames
If LCase(Right(fil eName, lenARCHIVE)) =
Right(vbARCHIV E_FILENAME, lenARCHIVE) Then
aryDates.Add( Replace (Left(fileName, 10),"_", "-" ) )
End If
Next

rptRHS_Menu.Dat aSource = aryDates
rptRHS_Menu.Dat aBind()
End Sub

</Script>

<!-- Sidebar (RHS Menu) -->
<h6 title="older blogs">archives </h6>
<img src="images/pixel_gr.gif" height="2" width="130"><br />

<asp:Repeater
ID="rptRHS_Menu "
Runat="Server" />
<ItemTemplate >
<ASP:HyperLin k
ID="lnkItem"
Text='<%# Container.DataI tem[0] %>'
NavigateUrl='<% # string.Concat(v bPOST_BACK_FILE ,
"?arc=", Container.DataI tem[0] %>'
Runat="Server" />
</ItemTemplate>
</asp:Repeater>
<!-- END RHS Menu -->


Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2311
by: Nathan Sokalski | last post by:
I am using a DataSet as the DataSource of a DataList in my code. The SQL used to get the data from the database begins with: SELECT members.organization,artists.artist,artists.email,artists.website,members.email FROM members INNER JOIN artists ON members.memberid=artists.memberid WHERE Notice that both tables involved in the SELECT statement have a field named
1
1399
by: Nathan Sokalski | last post by:
When I run my application, which uses databinding in a DataList, I recieve the following error: Server Error in '/' Application. -------------------------------------------------------------------------------- Public member 'title' on type 'DataRowView' not found. 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...
0
1082
by: fabrice | last post by:
Hello, I m using vb.net and framework 1.1 whithout VisualStudio. I'm trying to compile a personnal tool class in one assembly using VBC.exe . But i get an error in compilation and i don't know why. I think i miss a link to one assembly. thanks for you help fabrice
3
2002
by: ericw3 | last post by:
I am switching from Java to the .Net framework. In order to separate page layout design from the application code, I studied the codebehind tutorial by John at http://www.asp101.com/articles/john/codebehindnovs/default.asp In my GetQueryResult.aspx, I defined a DataGrid as follows: <asp:DataGrid ID ="dgQueryResults" runat="server" AllowPaging="True"
3
7216
by: Mauricio Pires | last post by:
All my pages work just fine on development, but as soon as I publish (deploy) to a W2K Server with .Net Framework 2.0 , I always get Compiler Error Message: BC30456: 'InitializeCulture' is not a member of 'ASP.default_aspx'. This happens for every page and after I created a MasterPage. Please help. I have seen multiple questions from people on this same issue, but with no answers.
1
3148
by: Patrick.O.Ige | last post by:
Hi guys, I just moved a project from my pc to a server production (to an ISP). on my pc it all works fine with no errors. After fireing up the first page "default.aspx" i get the error !!!!!!!!!!!!!!!!! arg!!!!!!!!!! below.. As anybody gone through this before??? "Invalid URI: There is an invalid sequence in the string. "
7
11480
by: Tony Girgenti | last post by:
Hello. I'm developing and testing a web application using VS.NET 2003, VB, .NET Framework 1.1.4322, ASP.NET 1.1.4322 and IIS5.1 on a WIN XP Pro, SP2 computer. I'm using a web form. I'm trying create a function in javascript to compare dates between calendar selected dates(that's not really my problem yet). I can't get the html to recognize the function that i have created. When i
0
1693
by: zykes | last post by:
can someone help me on this: This code worked on my other page but this one doesn't work on admin_golfCourse.aspx page. here's the code: <asp:DataGrid id="dbgridpres" runat="server" AllowPaging="False" AllowSorting="True" AutoGenerateColumns="False" GridLines="None" > <AlternatingItemStyle CssClass="altTable1"></AlternatingItemStyle> ...
3
2252
by: dancer | last post by:
I am using Framework 1.1.4322. Who can tell me why I'm getting this error? My code follows Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: BC30456: 'Text' is not a member of 'System.Web.UI.WebControls.CheckBoxList'.
0
8969
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9337
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9209
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8215
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6754
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4826
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3280
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2748
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.