1
votes

Want to know how from a Visual web part on one content page posting form data to another visual web part on another sharepoint content page.

Scenario: Sharepoint 2010 content page (Search page)

We have a SEARCH visual webpart on one page where user search for nearly 1000 parts information separated by comma separated values. Sharepoint 2010 content page (Result page)

I have a ResultGridView visual webpart on this result content page where i need to show result. Question:

Other than maintaining the searched Data in SESSION object what else approach can you recommend? How to pass the search data from one visual webpart to another visual webpart on another content page?

3

3 Answers

1
votes

As you're working in a web environment there is not much you can do besides storing stuff in the user's session object or via web services.

SharePoint supports the "Send to" other webpart functionality where you can send data from one WebPart to another, but on one page. For your scenario you are talking about sending data from WebPart1 on searchpage.aspx to WebPart2 on someotherpage.aspx. There is no simple method for that.

You either would have to implement a webservice so that WebPart2 can query that webservice for information or store the user's selection on the searchpage in his session or maybe even the cookie.

0
votes

You should not use SESSION for this purpose. Your best bet is the Query string parameters.

Let the one web part redirect to another page with specific query string values which can be read by second web part. Ofcourse, this method is not valid in sensitive scenarios.

You might have to reconsider the design of the solution.

0
votes

You can write a restfull webservice in order to be secured if you are using Query string.

Or push the results in another list and from that list create a visual webpart.