Quick u sempliċi: Dispożizzjoni Sit Web Uża Object Model SharePoint Fil C #

I tried searching for a little snippet code that would show how I can create a new SPWeb in a site collection. I didn’t find it as quickly or easily as I expected so I thought I’d slap together a little entry on the subject.

Dan il-kodiċi joħloq sit Wiki ġdida:

 SPSite siteCollection;

    siteCollection = ġdid SPSite("http://conchang-o9l8qi");

    SPWeb w = siteCollection.OpenWeb();

    w.Webs.Add("xyzzy", "xyzzy Title",
        "xyzzy description", 1033, SPWebTemplate.WebTemplateWIKI, falza, falza);

My initial searches failed because I was looking for phrases like "provision a web site using sharepoint object model" and the like.

Jekk inti tfittxija for "Webs.Add()", inti ser issib numru ta 'daħliet blog utli ħafna, MSDN articles and SDK documentation that go into depth on this subject. I definitely recommend dan is-sit.

</aħħar>

Abbona għall-blog tiegħi.

3 ħsibijiet dwar "Quick u sempliċi: Dispożizzjoni Sit Web Uża Object Model SharePoint Fil C #

  1. Rebecca Isserman
    I did this last year. I will say it was a lot easier to find resources last year. This year with more devs blogging it’s getting to be an information bog down. It has it’s good and bad qualities. We have more about stuff we didn’t know about last year, but we also have way too much on the same thing sometimes. There is a book by Todd Bleeker:
    It has some stuff about provisioning and hitting the object model a bit. I would say it’s one of the best books with information about the Object Model.
  2. Tobias Zimmergren
    Hi,
    Tinsiex dwar rimi l-oġġetti wara li inti qed isir magħhom. Tendenza li jiksbu pjuttost hog riżors jekk wieħed ikollu applikazzjoni tad-dwana ħafna fejn wieħed ma jiħux ir-rimi ta 'oġġetti in kunsiderazzjoni, speċjalment jekk hemm ħafna ta 'utenti konkorrenti.
    Dan l-artikolu jiddeskrivi l-MSDN rimi ta 'oġġetti pjuttost tajjeb, and takes up some examples of where the resources tend to run low if you forget about disposals 🙂
    I normalment do simili;
    użu(SPSite someSite = ġdid SPSite(http://litware.inc/)){
    //Do stuff here
    }
  3. Ebda isem
    WSS SDK fih ħafna eżempji. Thinking fit-termini tal-mudell oġġett SharePoint verament tgħin I sabu. Kif Siti huma maħżuna taħt Ġbir Site inti tfittex għal proprjetà ta SPSite li jkun fih is-siti (SPSite.AllWebs). Peress li din il-proprjetà hija ġabra ta 'SPWebCollection tip inti tmur hemm u sab id-diversi verżjonijiet tal-metodu Żid inkluż il-snippet kodiċi.

Ħalli Irrispondi

Your email address mhux se jkun ippubblikat. Meħtieġa oqsma huma mmarkati *