重命名文档工作区
答案在这里,我原来的问题如下......
更改文档工作区就是这么简单:
使用 .../web_reference/dws.asmx
using (Dws DWS = new Dws())
{
DWS.Credentials = CredentialCache.DefaultCredentials;
DWS.Url = "http://sharepointsite/" + Domain + "//_vti_bin//dws.asmx";
DWS.RenameDws("New Title goes here");
}
虽然使用 Webs.asmx 可能可以做到这一点,但我无法想象它出来了。
<======原始问题========>
我在 SharePoint 中创建了一个新的文档工作区,内容如下:
using (sp_Meetings.Meetings adm = new sp_Meetings.Meetings())
{
adm.Credentials = System.Net.CredentialCache.DefaultCredentials;
adm.Url = "http://sharepoint/_vti_bin/Meetings.asmx";
try
{
XmlNode CreatedSite = adm.CreateWorkspace(Domain, "Supplier.stp", 1033, new sp_Meetings.TimeZoneInf());
}
catch (Exception e)
{
MessageBox.Show("EXCEPTION: " + e.Message);
}
}
网站已正确创建,但 URL 和标题始终相同。
url: http://sharepointsite.com/sites/*domain*
page title: *domain*
显然这不起作用,因为我希望我的标题包含空格,而我的 URL 不包含空格。由于它们都从“域”变量中提取,我需要一个更细粒度的解决方案。有没有办法重新命名以编程方式制作的共享点页面?
我尝试了这个:
adm.SetWorkSpaceTitle("Nice Title");
但它抛出 SOAP 错误。
The answere is here, and my original question is below.....
Changing the document workspace is this easy:
using .../web_reference/dws.asmx
using (Dws DWS = new Dws())
{
DWS.Credentials = CredentialCache.DefaultCredentials;
DWS.Url = "http://sharepointsite/" + Domain + "//_vti_bin//dws.asmx";
DWS.RenameDws("New Title goes here");
}
While this may be possible using the Webs.asmx, I couldn't figure it out.
<======ORIGINAL QUESTION========>
I've created a new document workspace in SharePoint with the following:
using (sp_Meetings.Meetings adm = new sp_Meetings.Meetings())
{
adm.Credentials = System.Net.CredentialCache.DefaultCredentials;
adm.Url = "http://sharepoint/_vti_bin/Meetings.asmx";
try
{
XmlNode CreatedSite = adm.CreateWorkspace(Domain, "Supplier.stp", 1033, new sp_Meetings.TimeZoneInf());
}
catch (Exception e)
{
MessageBox.Show("EXCEPTION: " + e.Message);
}
}
The site is created properly, but the URL and the title are always the same.
url: http://sharepointsite.com/sites/*domain*
page title: *domain*
Obviously this doesn't work because I want my Title to contain spaces, and my URL to not contain spaces. Since they both pull from the "domain" variable, i need a more granular solution.Is there any way to re-title a sharepoint page made programatically?
I tried this:
adm.SetWorkSpaceTitle("Nice Title");
but it throws SOAP errors.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在创建站点之前您无法执行此操作。创建站点后,您需要获取 SPWeb 对象并使用该对象模型来更新标题。然后它应该可以毫无问题地工作......
You cannot do it before the site is created. Once the site is created, you need to get the SPWeb object and use the object model to update the title. it should then work without any issues...