Hi all,
I have installed ASP.NET AJAX 1.0 (the 01/23/2007 release)
I have a usercontrol with a Panel then a Repeater surrounded by an UpdatePanel.
<asp:Panel ID="panelApres1" runat="server" style="display:none;">
<p><span style="color:Red;font-size:xx-large">This popup popped at <asp:Label ID="labelApres2" runat="server" /> and all was well.</span></p>
<p><asp:Button ID="Button1" runat="server" Text="OK" /></p>
</asp:Panel>
<asp:UpdatePanel ID="up1" runat="server">
<ContentTemplate>
<asp:repeater id="RL" runat="server" EnableViewState="true">
<ItemTemplate>
<tr id="trElement" runat="server">
<td id="tdPictoType" runat="server" align="center"></td>
</tr>
</ItemTemplate>
</asp:repeater>
</ContentTemplate>
</asp:UpdatePanel>
In the ItemDataBound, I dynamically (= in code-behind) add a HoverMenuExtender to each item of the repeater.
private void RL_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
{
HoverMenuExtender hme4 = new HoverMenuExtender();
hme4.TargetControlID = ((HtmlTableCell)e.Item.FindControl("tdPictoType")).UniqueID;
hme4.PopupControlID = panelApres1.ID;
hme4.DynamicControlID = labelApres2.ID;
hme4.DynamicContextKey = IndTmp.Nom;
hme4.DynamicServiceMethod = "GetContent";
hme4.PopupPosition = HoverMenuPopupPosition.Right;
up1.ContentTemplateContainer.Controls.Add(hme4);
}
As you can see, HoverMenuExtender tries to populate the label labelApres2 in my panel panelApres1 with a web service GetContent included in the code-behind as follows :
[System.Web.Services.WebMethod()]
public static string GetContent(string contextKey)
{
string sIndName = contextKey;
return "<span style='color:blue;font-size:14pt'>" + sIndName + " " + DateTime.Now + "</span> ";
}
Note : I also have added [System.Web.Script.Services.ScriptService] before my class where all my code behind resides.
[System.Web.Script.Services.ScriptService]
public abstract class WUCAnnuaireResultat : WUCCcinetDefault
{ ...}
Unfortunately, when I mouseover the tdPictoType cell, all is displayed is "This popup popped at Web Service call failed: 500 and all was well."
Note : on the same page/usercontrol, my tests with HoverMenuExtender without a webservice/dynamic attributes do work.
My questions are :
1 - did I miss an important section in the Web.config in order for web services to work ?
2 - is my syntax of my webservice and its call correct ? (ie the [System.Web.Script.Services.ScriptService] and [System.Web.Services.WebMethod()])
I used the slightly outdated site
dynamic-content-made-easy-redux-how-to-use-the-new-dynamic-population-support-for-toolkit-controls
Thank you for your help !