473,327 Members | 1,920 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

event from itemtemplate not raised

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.
Nov 18 '05 #1
3 1276
Hi Daniel:

This should work, could you show us the ItemTemplate definition?

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Mon, 18 Oct 2004 13:03:31 +0200, Daniel
<da**********@zdv.uni-tuebingen.de> wrote:
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.


Nov 18 '05 #2
the template is:

<%@ Control Language="c#" AutoEventWireup="false"
Codebehind="AntragOldEditTemplate.ascx.cs"
Inherits="ServiceDnsDbWebClient.Templates.AntragOl dEditTemplate"
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

Scott Allen wrote:
Hi Daniel:

This should work, could you show us the ItemTemplate definition?

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Mon, 18 Oct 2004 13:03:31 +0200, Daniel
<da**********@zdv.uni-tuebingen.de> wrote:

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.


Nov 18 '05 #3
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.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Fri, 22 Oct 2004 12:41:48 +0200, Daniel
<da**********@zdv.uni-tuebingen.de> wrote:
the template is:

<%@ Control Language="c#" AutoEventWireup="false"
Codebehind="AntragOldEditTemplate.ascx.cs"
Inherits="ServiceDnsDbWebClient.Templates.AntragO ldEditTemplate"
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).DataIte m,
"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.DataListCommandEventArg s e)
{
this.RaiseBubbleEvent(source,e);
}

thanks for your help!

daniel

Scott Allen wrote:
Hi Daniel:

This should work, could you show us the ItemTemplate definition?

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Mon, 18 Oct 2004 13:03:31 +0200, Daniel
<da**********@zdv.uni-tuebingen.de> wrote:

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.



Nov 18 '05 #4

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

Similar topics

4
by: Nathan Sokalski | last post by:
I have a DataList that has an Button as one of the controls in it's ItemTemplate. The Button has a CommandName="delete" attribute, but when I click it the DeleteCommand event doesn't even get...
0
by: Nathan Sokalski | last post by:
I have a DataList that has an Button as one of the controls in it's ItemTemplate. The Button has a CommandName="delete" attribute, but when I click it the DeleteCommand event doesn't even get...
0
by: Silver Oak | last post by:
I have a DataGrid in which one of the columns is TemplateColumn that was created dynamically using iTemplate. I would like to have multi-row editing capability on the DataGrid. I'm trying to...
0
by: Bieniu | last post by:
I have DataList control on my own contro land it is bind to SqlDataSource control. My problem is that DataList is getting needed data twice what is for me very strange. I have some code in...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.