ASP.NET Web 部件静态连接
我在两个不同的 Web 部件区域中有两个 Web 部件。 他们使用网格视图提供主/详细信息场景。 它们是使用静态连接定义的。 最初这效果很好。
一旦我关闭其中一个 Web 部件,我就会收到消息“您即将关闭该 Web 部件。它当前正在向其他 Web 部件提供数据,如果关闭此 Web 部件,这些连接将被删除。单击“确定”继续。
这在 ,当我打开目录区域并重新添加 Web 部件(添加得很好)时,部件之间的连接已断开(如消息所述)。
本身很好,所以我单击“关闭”,我的部件关闭。但是 在我的 HTML 中仍然可见。我只能假设它使用 ASPNET 成员资格或其他来记住连接的 ID,而不是启用它。
我的问题是如何在代码或其他中重新启用连接!
?
I have two webparts in two different webpart zones. They provide a Master/Details scenario using gridviews. They are defined using static connections. Initially this works great.
As soon as I close one of the webparts I get the message "You are about to close the webpart. It is currently providing data to other webparts, and these connections will be deleted if this webpart is closed. Click OK to continue.
This in itself is fine so I click close and my part closes. However when I open the catalog zone and re-add the webpart (which gets added fine) the connection between the parts is broken (as described by the message).
However my webpart connection in my HTML is still visible. I can only assume it uses the ASPNET membership or other to remember the ID of the connection and not to enable it.
My question is how do I re-enable the connection in code or other!?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,我已经解决了我的问题。 我将以下内容添加到 WebpartManager.WebpartAdded() 中,
总而言之,它如何知道/存储已删除的连接并记住不允许其处于活动状态!? 如果我可以阻止连接被删除或重新启用它,那就容易多了。 我知道动态连接是一种选择,但我不希望用户拥有这种能力,因为他们很难理解您可以在屏幕上拖动 Web 部件这一事实。 对他们来说,人脉关系就像火箭科学。
OK I have solved my issue. I added the following into WebpartManager.WebpartAdded()
All said, how does it know/store the connection that was removed and remember to NOT allow that to be active!? It would be much easier if I could stop the connection being removed or re-enable it. I know dynamic connections are an option but I dont want users having this ability as they having a hard enough job understanding the fact you can drag a webpart around the screen. Connections are rocketscience to them.