Ask a Question related to ASP.NET General, Design and Development.
-
Barry #1
Handling events in container controls?
Hi,
I have a sub in a user control that looks like this:
Public Sub BatchDetail_ItemCommand(ByVal Sender As Object, ByVal e
As DataListCommandEventArgs)
Dim cmd As String = CType(e.CommandSource,
LinkButton).CommandName
Dim senderlist As DataList = CType(Sender, DataList)
Select Case cmd
Case "aestheticBatch"
senderlist.SelectedItemTemplate =
Page.LoadTemplate("./Components/AestheticDetailTemplate.ascx")
Case "adhesiveBatch"
senderlist.SelectedItemTemplate =
Page.LoadTemplate("./Components/AdhesiveDetail.ascx")
Case "aestheticAdhesiveBatch"
senderlist.SelectedItemTemplate =
Page.LoadTemplate("./Components/AestheticAdhesive.ascx")
End Select
senderlist.SelectedIndex = e.Item.ItemIndex
senderlist.DataBind()
End Sub
It's used to dynamically load a template into the SelectedItemTemplate
of my DataList. Now, inside the template file
(AestheticDetailTemplate.ascx), I have another DataList with the
following definition:
<asp:datalist id=AestheticDetail datasource='<%#
GetAestheticDetail(DataBinder.Eval(CType(Container ,DataListItem).DataIte
m, "AestheticBatch")) %>' OnItemCommand="BatchDetail_ItemCommand"
runat="server" >
This DataList also contains the following control:
<asp:Linkbutton ID="Label6" Runat="server" text='<%#
DataBinder.Eval container.DataItem, "AestheticAdhesiveBatch")
%>'commandname = "aestheticadhesivebatch"/>
I want the OnItemCommand from this DataList to call the sub in its
container (BatchDetail_ItemCommand). 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 'DataListCommandEventArgs' is not defined" on the
subroutine. I've tried adding a declaration for
System.Web.UI.WebControls.CommandEventArgs 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 [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Barry Guest
-
Handling Events Of DataGrid Template Item Controls - UNANSWERED
If I place a checkbox control into a template column of a DataGrid, how do I gain access to the CheckChanged event handler procedure that... -
Controls container
Hi. I'm creating a .NET server component that inherit from Table (WebControls) class. It's a container that implement this html architecture... -
Events Handling Order
Hi all, I'm a total newbie, so this might be stupid... Anyway, I've created an expanding tree of categories control, based on DataList. It works... -
Loosing Datagrid events due to container naming corruption problems...Help
While try to find out why sometime events were not being handled item_command the following was found: -Events, the control is lineitems, and the... -
Handling Events in Nested Controls
Hi, I have nested User Controls like below. User_Control_1 User_Control_11 User_Control_12(contains method DisplayMessage) ...



Reply With Quote

