在SharePoint列表中需要帮助. [英] Need help in SharePoint list.

查看:103
本文介绍了在SharePoint列表中需要帮助.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我得到了使用Visual Studio 2010创建自定义共享点列表的代码.但是我可以在哪里将这些代码放置在Visual Studio 2010中?
没有任何提及.有人可以帮我吗,我真的很挣扎.请帮助我.这是
代码:

hi all,
I got a code to create custom sharepoint list using visual studio 2010. But where can i place these code visual studio 2010
not any where its mentioned. can somebody help me pls.i am really struggling. pls help me somebody.Here is the
code:

using (SPSite oSPsite = new SPSite("http://Web URL"))
{
    oSPsite.AllowUnsafeUpdates = true;
 
    using (SPWeb oSPWeb = oSPsite.OpenWeb())
    {
      oSPWeb.AllowUnsafeUpdates = true;
 
      /* 1. create list from custom ListTemplate present within ListTemplateGalery */
      SPListTemplateCollection lstTemp = oSPsite.GetCustomListTemplates(oSPWeb);
      SPListTemplate template = lstTemp["custom template name"];
      oSPWeb.Lists.Add("List Name", "Description", template);
 
 
      /* 2. create list from sharepoint list content type (e.g. Links) */
      oSPWeb.Lists.Add("List Name", "Description", SPListTemplateType.Links);
 
      oSPWeb.AllowUnsafeUpdates = false;
    }
 
    oSPsite.AllowUnsafeUpdates = false;
}

推荐答案

如果要在计算机上执行此操作,则在设置共享点时可以使用.

为此,您可以创建一个网页,询问用户所有参数,并在用户单击创建按钮时执行此代码(在按钮单击事件上编写此代码)

希望这是您的解决方案,否则让我知道,然后我想进一步澄清您的问题.
if you want to do this at the machine you are hsting the sharepoint then this could will work.

For this you can create a webpage ask all the parameters from user and when user click a create button excute this code(write this code on button click event)

hope this is solution for you otherwise just let me know then i want more clearification on your question.


这篇关于在SharePoint列表中需要帮助.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆