Bonjour Seb,
Merci pour votre réponse, mais toujours ce pb de notification, grrr... Je viens de changer d'@, pour voir.
Entre temps, j'ai vu que je ne créais pas le controle comme il fallait, j'ai bien fait ça:
SectionHeadControl mySh = (SectionHeadControl)(LoadControl("~/controls/SectionHeadControl.ascx"));
mySh.Section = tbl.ID;
mySh.IsExpanded = false;
mySh.IncludeRule = true;
mySh.Text = (affNb) ? titre.ToUpper() + " (" + adhs.Count.ToString() + ")" : titre.ToUpper();
Cellule.Controls.Add(mySh);
Mais rien à faire, ne fonctionne pas... Il ne doit pas vouloir le créer dans une cellule de tableau.
J'ai donc fait un truc à la main:
string strTab = "<div id='desc" + LibIdGen.ToString() + "' style='display:none;'>Mon contenu à cacher/afficher</div>";
LiteralControl tab = new LiteralControl(strTab);
...
LiteralControl img = new LiteralControl(titre.ToUpper() + " (" + adhs.Count.ToString() + ") "
+ "<a href=' affiche(" + LibIdGen.ToString() + ");'>"
+ "<img src='" + ResolveUrl("Images/plus.gif") + "' id='img" + LibIdGen.ToString() + "' border=0 /></a>");
Cellule.Controls.Add(img);
Et avec un javascript qui contient cette fonction:
function affiche(cle) { // Affiche ou cache un contenu
obj1 = window.document.getElementById('desc'+cle);
obj2 = window.document.getElementById('img'+cle);
if(obj1.style.display=='none') {
obj1.style.display='block';
obj2.src = obj2.src.replace('plus.gif','minus.gif');
} else {
obj1.style.display='none';
obj2.src = obj2.src.replace('minus.gif','plus.gif');
}
}
Ca fonctionne bien, mais vraiment, des fois, j'ai vraiement l'impression de faire du PHP avec dot net. :-(