views:

668

answers:

4

I am doing webparts in sharepoint and I want to transfer the data from one to another. I tried the 3 ways but they all fail. Any idea? It just says An unexpected error has occurred.

A: 

'Unexpected error' == server error 500? if so, turn on custom error reporting in web.config to find out what the problem actually is.

n8wrl
now the query string works in some cases and some cases not !!!it saysNo item exists at http://*******/BIMS/Shared Documents/EditQuestion.aspx?id=3. It may have been deleted or renamed by another user.
Ahmad Farid
A: 

Google "connected web parts" - there's a built-in, easy way to pass data across parts.

Greg Hurlman
+1  A: 

Hi Ahmad

If you want to transfer information from one web part to another on the same page the look at "Connected web parts" as Greg suggest

If you want to transfer information to web parts on another page the use the query string but don't use names like "id", "listid", "field" which has special meaning to SharePoint like http:/xxx/Shared Documents/EditQuestion.aspx?id=3 which tells SharePoint to load the doc with ID=3 from the Shared Documents and use that as SPContent.Current.Item

Per Jakobsen
yes man i thx. i changed it to k=3 and it worked!!but cant i use session variables or view state?
Ahmad Farid
View state can be used without any problem but only works on the single page and you should use it for a control/web part to remeber things which isn't remembered by the html, to communicate with other web-parts use Connections. Session state works fine in MOSS, but is by default disabled in WSS.
Per Jakobsen
A: 

For the question "No item exists at url, it may have been deleted or renamed by another user", here is good explanation and solution. http://praveenbattula.blogspot.com/2010/02/sharepoint-exception-no-item-exists-url.html

Rare Solutions