G
Guest
Hi all,
in my previous post I've wrong typed some tems.. this is the corrected post.
in a aspx page I have a repeater like this:
<asp:repeater id=repeaterResults runat="server"
OnItemCommand="RepeaterResult_Event">
<HeaderTemplate>
<table width="515" border="0" cellpadding="3" cellspacing="0">
</HeaderTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
<SeparatorTemplate>
<tr><td colspan="4"><hr></td></tr>
</SeparatorTemplate>
</asp:repeater>
in the code behind file I dinamically load the Itemtemplate with this code:
repeaterResults.DataSource = objPds;
string templateName = "templates/BSResultTextTemplate.ascx";
repeaterResults.ItemTemplate = Page.LoadTemplate(templateName);
repeaterResults.DataBind();
Always in the same code behind file, I've defined the Method specified in
the OnItemCommand property of repeater:
public void RepeaterResult_Event(object sender, RepeaterCommandEventArgs e)
{
string s = " SSS ";
}
below you can see the content of BSResultTextTemplate.ascx :
<tr>
<td class="nerotesti" width="155"><asp:LinkButton id="CmdVisualizzaReperto"
runat="server" CommandName="ItemCommand" CommandArgument=<%#
DataBinder.Eval(Container,"DataItem.ID") %> ><%#
DataBinder.Eval(Container,"DataItem.ID") %></asp:LinkButton></td>
<td class="nerotesti" width="160"><%#
DataBinder.Eval(Container,"DataItem.Culture") %></td>
<td class="nerotesti" width="160"><%#
DataBinder.Eval(Container,"DataItem.Subject") %></td>
<td class="nerotesti" width="60"> </td>
</tr>
Now the problem.... the template is loaded successfully but when I click on
one of the linkbutton generated, the method RepeaterResult_Event is not
fired...
on the other side if I insert the code of template directly in the repeater
definitition and don't load an external template when I click on one of the
linkbutton generated all work fine and the method RepeaterResult_Event is
invoked.
Please have anyone a solution for this?
Thank you.
Antonio.
in my previous post I've wrong typed some tems.. this is the corrected post.
in a aspx page I have a repeater like this:
<asp:repeater id=repeaterResults runat="server"
OnItemCommand="RepeaterResult_Event">
<HeaderTemplate>
<table width="515" border="0" cellpadding="3" cellspacing="0">
</HeaderTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
<SeparatorTemplate>
<tr><td colspan="4"><hr></td></tr>
</SeparatorTemplate>
</asp:repeater>
in the code behind file I dinamically load the Itemtemplate with this code:
repeaterResults.DataSource = objPds;
string templateName = "templates/BSResultTextTemplate.ascx";
repeaterResults.ItemTemplate = Page.LoadTemplate(templateName);
repeaterResults.DataBind();
Always in the same code behind file, I've defined the Method specified in
the OnItemCommand property of repeater:
public void RepeaterResult_Event(object sender, RepeaterCommandEventArgs e)
{
string s = " SSS ";
}
below you can see the content of BSResultTextTemplate.ascx :
<tr>
<td class="nerotesti" width="155"><asp:LinkButton id="CmdVisualizzaReperto"
runat="server" CommandName="ItemCommand" CommandArgument=<%#
DataBinder.Eval(Container,"DataItem.ID") %> ><%#
DataBinder.Eval(Container,"DataItem.ID") %></asp:LinkButton></td>
<td class="nerotesti" width="160"><%#
DataBinder.Eval(Container,"DataItem.Culture") %></td>
<td class="nerotesti" width="160"><%#
DataBinder.Eval(Container,"DataItem.Subject") %></td>
<td class="nerotesti" width="60"> </td>
</tr>
Now the problem.... the template is loaded successfully but when I click on
one of the linkbutton generated, the method RepeaterResult_Event is not
fired...
on the other side if I insert the code of template directly in the repeater
definitition and don't load an external template when I click on one of the
linkbutton generated all work fine and the method RepeaterResult_Event is
invoked.
Please have anyone a solution for this?
Thank you.
Antonio.