SharePoint 2010 Discussion thread URL subject with : ' characters
-
2012年6月9日 2:14
Hi,
I have a custom webpart that reads a discussion list. i am able to get the URL and direct the user to the actual discussion topic. But for some threads where the subject incudes non-text characters such as : ' etc.. the link doesnt work
Sharepoint adds %20 for space and : sign in my case and %27 for '
but whgen I pass the url value it doesnt convert the ' and : characters
Discussion subject title:Lewis Hamilton future: McLaren form is 'not key'
when you click on the thread from the list, the link is:
http://xxx/Lists/Team%20Discussion/Lewis%20Hamilton%20future%20McLaren%20form%20is%20%27not%20key%27
when I get the URL via C# it gives me:
Lists/Team Discussion/Lewis Hamilton future: McLaren form is 'not key'
then, when I try to access the link, it fails becasue the : and ' characters are not converted.
http://xxx/Lists/Team%20Discussion/Lewis%20Hamilton%20future:%20McLaren%20form%20is%20'not%20key'
how can I get around this?
Thank you for your help and advice.
D
全部回复
-
2012年6月11日 4:57版主
Hi delbacca,
You can encode the discussion title then construct the link like the above first URL in your custom web part, then check again,
http://msdn.microsoft.com/en-us/library/zttxte6w%28VS.80%29.aspx
Thanks
Daniel Yang
TechNet Community Support
- 已建议为答案 Victor Khazanov 2012年6月11日 5:46
- 已标记为答案 Daniel YangMicrosoft Contingent Staff, Moderator 2012年6月21日 1:47

