event from itemtemplate not raised

D

Daniel

hi all,

i have a dynamically loaded item template for a datalist that contains a
button element.
this button does not raise an event when clicked.
Is there something special to care for with a dynami template?

thanks for any help.

d.
 
D

Daniel

the template is:

<%@ Control Language="c#" AutoEventWireup="false"
Codebehind="AntragOldEditTemplate.ascx.cs"
Inherits="ServiceDnsDbWebClient.Templates.AntragOldEditTemplate"
TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>
<P>
<asp:Button id="Button_Aenderungsantrag"
CommandName="AnderungenSpeichern" runat="server" Text="Ändrungen
speichern"></asp:Button></P>
<P>
<asp:Label id=AntragInternerZugangId runat="server" Text='<%#
DataBinder.Eval(((DataListItem)Container).DataItem,
"AntragInternerZugangId") %>'>
</asp:Label></P>
.....

and here the user control itemcommand which only gets invoked when the
datalist has a static template

private void DataList1_ItemCommand(object source,
System.Web.UI.WebControls.DataListCommandEventArgs e)
{
this.RaiseBubbleEvent(source,e);
}

thanks for your help!

daniel
 
S

Scott Allen

Hmm - when you dynamically load the template do you load it on every
postback operation? If it's only loaded inside of !Page.IsPostback
this could cause the problem you are seeing.
 

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,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top