There is no consumer connection point 'IMessageConsumer' on 'bla [2]'.

P

Patrick Sannes

I created a static connected webpart.

INTERFACE:
public interface IMessage
{
string Message { get;}
}

USERCONTROL PROVIDER:
public partial class Control1 : System.Web.UI.UserControl, IMessage,
IWebPart
{
protected void Page_Load(object sender, EventArgs e)
{

}
[ConnectionProvider("Message","IMessageProvider")]
public IMessage GetMessage()
{
return this;
}
public string Message
{
get
{
return TextBox1.Text;
}
}


#region IWebPart Members (ETC)

USERCONTROL CONSUMER
public partial class Control2 : System.Web.UI.UserControl, IWebPart
{
protected void Page_Load(object sender, EventArgs e)
{

}

private IMessage _message;


[ConnectionConsumer("Message","IMessageConsumer",AllowsMultipleConnections=true)]
void SetMessage(IMessage message)
{
this._message = message;
}

protected override void OnPreRender(EventArgs e)
{
if (_message != null)
Label1.Text = _message.Message;
base.OnPreRender(e);
}
#region IWebPart Members (ETC)

DEFAULT.ASPX:

<body>
<form id="form1" runat="server">

<div>
<asp:WebPartManager ID="WebPartManager1" runat="server"
Personalization-Enabled="true">
<StaticConnections>
<asp:WebPartConnection ID="conId"
ConsumerID="dataConsumer" ProviderID="dataProvider"
ConsumerConnectionPointID="IMessageConsumer"
ProviderConnectionPointID="IMessageProvider" />
</StaticConnections>

</asp:WebPartManager>
<asp:WebPartZone ID="WebPartZone1" runat="server">
<ZoneTemplate>
<uc1:Control1 ID="dataProvider" runat="server" />
<uc2:Control2 ID="dataConsumer" runat="server" />
</ZoneTemplate>
</asp:WebPartZone>
&nbsp;&nbsp;
</div>
</form>
</body>

And I get this error :"There is no consumer connection point
'IMessageConsumer' on 'bla [2]'. "... Checkded it with multiple
tutorials, but can't find what I'm doing wrong.

Hope someone can help me!
Regards,
Patrick
 
P

Patrick Sannes

USERCONTROL CONSUMER
public partial class Control2 : System.Web.UI.UserControl, IWebPart
{
protected void Page_Load(object sender, EventArgs e)
{

}

private IMessage _message;

[ConnectionConsumer("Message","IMessageConsumer",AllowsMultipleConnections=­true)]
void SetMessage(IMessage message)
{
this._message = message;
}

Solved it, I forgot to make the SetMessage public ;-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,962
Messages
2,570,134
Members
46,692
Latest member
JenniferTi

Latest Threads

Top