从另一个 Web 部件单击按钮后需要重新加载 sharepoint 2007 Web 部件的信息
我是共享点开发的新手。我在一个页面上附加了 2 个 Web 部件。第一个 Web 部件 (MyTestingWebpart1) 基本上只插入数据,其他 Web 部件 (MyTestingWebpart [2]) 显示数据库中的记录。现在我的问题是,当我尝试单击“保存”按钮时,不知何故,我不知道如何刷新显示新插入记录的 Web 部件。这可能吗?
我在 MyTestingWebPart[2] 的页面加载事件中添加了一个查询。附加的两个 Web 部件都是 Web 用户控件。谢谢!
I am new in sharepoint development. I have 2 webparts attached on a page. The first webpart (MyTestingWebpart1) basically it does only inserting of data and the other webpart (MyTestingWebpart[2]) displays the records from the database. Now my problem is when I try to click on the save button, somehow I don't know how to refresh the webpart that displays the newly inserted record. Is this possible?
I have added a query at the page load event of MyTestingWebPart[2]. Both of the webparts attached are web user controls. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我建议您连接这两个 Web 部件。让 Web Part 1 成为生产者,让 Web Part 2 成为消费者。
请注意,您实际上并不需要从一个 Web 部件传递任何内容到另一个 Web 部件(您可以传递插入的记录的 ID),但只需生产者-消费者连接即可确保在第一个 Web 部件将任何数据插入到其中时刷新您的第二个 Web 部件数据库。
I would suggest that you connect both the Web Parts. Make Web Part 1 the producer, and 2 the consumer.
Note that you do not really need to pass anything from one to another (You may pass the ID of record inserted), but just the producer-consumer connection would ensure that your second web part is refreshed once the first web part inserts any data into the database.
问题是您的用户控件不会重新加载,因此解决方法是调用 Response.Redirect("放置 Web 部件的同一页面的 URL")
The problem is that your user control does not get re loaded, so a work around is to call Response.Redirect("URL of the same page where your web parts are placed")