Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

As sharepoint 2010 can not deploy back to the source what could be the best method of getting data back into the source site collection?

eg lets say a webpart asks a user some questions, which needs to be added to a list. The question is how does it get into the Source site collection copy of the list.

Currently the only method i can think of is the webpart calls a WCF service which does have permissions through firewalls back to soure site collection, where it updates the list.

Any other or better suggestions?

share|improve this question

migrated from stackoverflow.com Jun 4 '11 at 9:04

This question came from our site for professional and enthusiast programmers.

    
I'm a little confused, what do you mean "back to the source"? Your webpart example sounds fully feasible, but I don't understand what you mean about getting back into the source site collection copy of the list? –  James Love Jun 4 '11 at 10:18
    
Ben, what is your context? do you try to tell us a content deployment, staging-production, editorial-publishing story? Please elaborate. –  Alexey Krasheninnikov Jun 4 '11 at 20:13
    
Once again, please edit your question to describe the topology you're deploying content in. We need to know whether you have one farm or two. I suspect, you have a cross-farm scenario here. –  Alexey Krasheninnikov Jun 6 '11 at 14:53
add comment

1 Answer 1

The code-behind for Web Parts runs server-side, and has access to the SPContext that will provide the current SPSite and SPWeb objects providing access to lists and libraries through the server object model. If you use controls for user input in your Web Part they will post back to the server like any other ASP.NET control. Bind event handlers in your Web Part and you can program your form like normal ASP.net.

If your Web Part is rendering out some client-side code, then you will either want to set control values and force a form submit, or update the server list directly using either Ajax with the List Data service, the Client OM, or even Ajax with the Lists.ASMX soap service ala. SPServices, etc.

share|improve this answer
    
Thanks for the reply. The first part in the reply the problem is there is two sites internal authoring site and an external publishing site. Yes SPcontext will all work for the external site, but every night content deployment will a) overwite any external list. b) the external list will not appear internally Creating a WCF service, will give a possible route back into the internal infrastucture but this would mean there is a whole back in through the firewall. Which i am assu –  ben Jun 6 '11 at 10:27
    
A good answer but the cross-farm content deployment nature of the question is not taken into consideration –  Alexey Krasheninnikov Jun 6 '11 at 14:02
    
@ben btw, your usage of 'external list' may be ambiguous. You don't mean BCS external content types by that, do you? –  Alexey Krasheninnikov Jun 6 '11 at 14:51
    
I didn't read anything about cross-farm content deployment in the original question? –  Chris Beckett Jun 7 '11 at 0:38
    
Unfortunately, the question is very vague, I concur. But there is a hint in "permissions through firewalls back to soure site collection" that suggests the cross-farm aspect. –  Alexey Krasheninnikov Jun 10 '11 at 6:34
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.