473,387 Members | 1,516 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,387 software developers and data experts.

Problem with OnItemButton event and Loadtemplate

Hi all,
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 OnItemButton 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.
Nov 19 '05 #1
0 998

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

Similar topics

1
by: Barry | last post by:
I have a three-level drilldown report. The top level is a DataList. When an item is selected, a new DataList is instantiated in the SelectedItem template. I'd like to have the same thing happen...
4
by: Antonio Carpentieri | last post by:
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"...
0
by: rioka | last post by:
I'm going to display data with a repeater control, and each row can have a different layout depending on the value of a column: for example, if column A contains value "1" I want to display Column...
0
by: btg | last post by:
We have a situation where some html content is generated and stored in a xxx.aspx file. When we need to show that content, we copy this file to a file called loadtemplate.aspx and then use that...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.