I'm passing the Folder.Id.UniqueId
property of a folder retrieved from a FindFolders
query via the query string to another page. On this second page I want to use that UniqueId
to bind to the folder to list its mail items:
string parentFolderId = Request.QueryString["id"];
...
Folder parentFolder = Folder.Bind(exchangeService, parentFolderId);
// do something with parent folder
When I run this code it throws an exception telling me the Id is malformed. I thought maybe it needs to be wrapped in a FolderId
object:
Folder parentFolder = Folder.Bind(exchangeService, new FolderId(parentFolderId));
Same issue.
I've been searching for a while, and have found some suggestions about Base64/UTF8 conversion, but again that did not solve the problem.
Anyone know how to bind to a folder with a given unique id?
I had a similar problem and used urlencode/urldecode to make sure the ids was properly formatted. However one of the users had messages that would result in errors.
It turned out that some of the ids had a + sign in them resulting in a ' ' blank space when decoded. A simple replace of ' ' the '+' did the trick.
Could be the problem.
I know the question was asked a long time ago, but this might be helpful to others in the future.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With