What Does This Mean?

W

Wayne Wengert

I have an ASP.NET page in which I include a datalist that is bound to a
datareader. I am trying to use the OnItemDataBound event to change the
contents of the NavigateURL property of a hyperlink. I am getting an error I
do not understand. Any explinations woul;d be appreciated. The error report
is:

Compiler Error Message: BC30408: Method 'Public Sub
ItemDataBoundEventHandler(sender As Object, e As
System.Web.UI.WebControls.DataGridItemEventArgs)' does not have the same
signature as delegate 'Delegate Sub DataListItemEventHandler(sender As
Object, e As System.Web.UI.WebControls.DataListItemEventArgs)'.

Source Error:


Line 68: Judge/Caption for Evaluation</asp:Label>
Line 69: <p>
Line 70: <asp:DataList id="judgelist" runat="server"
onitemdatabound="ItemDataBoundEventHandler">
Line 71: <HeaderTemplate>
Line 72: <table width="90%">


====================================================================
The relevant DataList Code is as follows:

<asp:DataList id="judgelist" runat="server"
onitemdatabound="ItemDataBoundEventHandler">
<HeaderTemplate>
<table width="90%">
<tr bgcolor="#b0c4de">
<th>
Action</th>
<th>
Judge</th>
<th>
Caption</th>
<th align="center">
Proposed<br />
Status</th>
</HeaderTemplate>
<ItemTemplate>
<tr bgcolor="lightcyan">
<td id="myLink" runat="server">
<asp:HyperLink id="XX" runat="server"
NavigateUrl= strLink Text= "Evaluate" ></asp:HyperLink>
</td>
<td>
<%#Container.DataItem("JudgeName")%>
</td>
..............

The "ItemDataBoundEventHandler" code is as follows:

Sub ItemDataBoundEventHandler(sender as Object, e as DataGridItemEventArgs)
If e.Item.ItemType = ListItemType.Item OR _
e.Item.ItemType = ListItemType.AlternatingItem then
'Check to see if the price is below a certain threshold
Dim strLink as String
strLink = Convert.ToDouble(DataBinder.Eval(e.Item.DataItem,
"price"))

If DataBinder.Eval(e.Item.DataItem, "proposedstatus") Is
DBNull.Value then
strLink = ""
End If
End If
End Sub
 
J

Jos

Wayne said:
I have an ASP.NET page in which I include a datalist that is bound to
a datareader. I am trying to use the OnItemDataBound event to change
the contents of the NavigateURL property of a hyperlink. I am getting
an error I do not understand. Any explinations woul;d be appreciated.
The error report is:

Compiler Error Message: BC30408: Method 'Public Sub
ItemDataBoundEventHandler(sender As Object, e As
System.Web.UI.WebControls.DataGridItemEventArgs)' does not have the
same signature as delegate 'Delegate Sub
DataListItemEventHandler(sender As Object, e As
System.Web.UI.WebControls.DataListItemEventArgs)'.

Probably a Copy/Paste mistake:
just change DataGridItemEventArgs into DataListItemEventArgs.
 

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

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,151
Latest member
JaclynMarl
Top