C'est la première chose que j'ai vérifié quand j'ai eu le message. A l'origine mon namespace comportait un underscore. Par acquis de conscience, je l'ai retiré, mais rien n'y a fait.
J'ai aussi pensé que ça pouvait venir de mon "entête" de classe, mais je ne verrais pas bien pourquoi :
1 2
|
[XmlRoot(Namespace = "EspCom")] |
Voici le code de ma classe avec ce fameux XmlRoot, qui par ailleurs fonctionne très bien sur d'autres projets...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
|
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Runtime.InteropServices;
using System.Xml.Serialization;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebPartPages;
namespace EspCom
{
[Guid("F6CED081-8008-4b66-8A53-F0FE0EE59190")]
[XmlRoot(Namespace = "EspCom")]
public class EC_WebpartAdmin : WebPart
{
protected string ucPath = @"~/_controltemplates/";
protected string ucAdministration = @"EC_UCAdmin.ascx";
protected EC_UCAdmin _controlAdministration = null;
protected override void CreateChildControls()
{
try
{
Table table = new Table();
table.BorderWidth = 0;
table.CellPadding = 0;
table.CellSpacing = 0;
table.GridLines = GridLines.None;
table.Width = Unit.Percentage(100);
table.CssClass = "Mybody";
TableRow tr = new TableRow();
TableCell tcMenu = new TableCell();
tcMenu.Width = Unit.Pixel(210);
tcMenu.VerticalAlign = VerticalAlign.Top;
TableCell tcMain = new TableCell();
tcMain.Width = Unit.Percentage(100);
tcMain.VerticalAlign = VerticalAlign.Top;
tr.Cells.Add(tcMenu);
tr.Cells.Add(tcMain);
table.Rows.Add(tr);
Table tableMain = new Table();
tableMain.BorderWidth = 0;
tableMain.CellPadding = 0;
tableMain.CellSpacing = 0;
tableMain.GridLines = GridLines.None;
tableMain.Width = Unit.Percentage(100);
TableRow trHead = new TableRow();
TableCell tcHead = new TableCell();
tcHead.Width = Unit.Percentage(100);
tcHead.VerticalAlign = VerticalAlign.Top;
trHead.Cells.Add(tcHead);
TableRow trCenter = new TableRow();
TableCell tcCenter = new TableCell();
tcCenter.Width = Unit.Percentage(100);
tcCenter.VerticalAlign = VerticalAlign.Top;
trCenter.Cells.Add(tcCenter);
tableMain.Rows.Add(trHead);
tableMain.Rows.Add(trCenter);
tcMain.Controls.Add(tableMain);
table.Rows.Add(tr);
_controlAdministration = (EC_UCAdmin)this.Page.LoadControl(ucPath + ucAdministration);
tcCenter.Controls.Add(_controlAdministration);
Controls.Add(new LiteralControl("<div id=integratedpage>"));
Controls.Add(table);
Controls.Add(new LiteralControl("</div>"));
}
catch(Exception ex) {
throw;
}
}
protected override void RenderContents(HtmlTextWriter writer)
{
base.RenderContents(writer);
}
}
} |
Le safecontrol dans le web.config :
<SafeControl Assembly="Nomduclient_EspaceCommunicants, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d2583bfae56aeb52" Namespace="EspCom" TypeName="*" Safe="True" />
Si quelqu'un a une idée, je suis preneur...
Partager