简体   繁体   中英

Need to reload the information of the sharepoint 2007 webpart after a button is clicked from another webpart

I am new in sharepoint development. I have 2 webparts attached on a page. The first webpart (MyTestingWebpart 1 ) 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!

替代文字

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 technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM