Hi,
I have a sub in a user control that looks like this:
Public Sub BatchDetail_Ite mCommand(ByVal Sender As Object, ByVal e
As DataListCommand EventArgs)
Dim cmd As String = CType(e.Command Source,
LinkButton).Com mandName
Dim senderlist As DataList = CType(Sender, DataList)
Select Case cmd
Case "aestheticBatch "
senderlist.Sele ctedItemTemplat e =
Page.LoadTempla te("./Components/AestheticDetail Template.ascx")
Case "adhesiveBa tch"
senderlist.Sele ctedItemTemplat e =
Page.LoadTempla te("./Components/AdhesiveDetail. ascx")
Case "aestheticAdhes iveBatch"
senderlist.Sele ctedItemTemplat e =
Page.LoadTempla te("./Components/AestheticAdhesi ve.ascx")
End Select
senderlist.Sele ctedIndex = e.Item.ItemInde x
senderlist.Data Bind()
End Sub
It's used to dynamically load a template into the SelectedItemTem plate
of my DataList. Now, inside the template file
(AestheticDetai lTemplate.ascx) , I have another DataList with the
following definition:
<asp:datalist id=AestheticDet ail datasource='<%#
GetAestheticDet ail(DataBinder. Eval(CType(Cont ainer,DataListI tem).DataIte
m, "AestheticBatch ")) %>' OnItemCommand=" BatchDetail_Ite mCommand"
runat="server" >
This DataList also contains the following control:
<asp:Linkbutt on ID="Label6" Runat="server" text='<%#
DataBinder.Eval container.DataI tem, "AestheticAdhes iveBatch")
%>'commandname = "aestheticadhes ivebatch"/>
I want the OnItemCommand from this DataList to call the sub in its
container (BatchDetail_It emCommand). I want this sub to load another
template when it sees this CommandName.
The problem I have is that when I click down to this level, I get
"BC30002: Type 'DataListComman dEventArgs' is not defined" on the
subroutine. I've tried adding a declaration for
System.Web.UI.W ebControls.Comm andEventArgs in both the template's html
and the code-behind where the sub is, which didn't work.
Any ideas? I would think I should be able to do this.
Thanks,
Barry
*** Sent via Developersdex
http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!