Brzo i jednostavno: Pružanje Web Site Korištenje SharePoint Object Model u 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.

Ovaj kod stvara novi Wiki stranice:

 SPSite siteCollection;

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

    SPWeb w = siteCollection.OpenWeb();

    w.Webs.Add("xyzzy", "xyzzy Title",
        "xyzzy description", 1033, SPWebTemplate.WebTemplateWIKI, lažan, lažan);

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

Ako Usporedite for "Webs.Add()", naći ćete niz vrlo korisnih blogova, MSDN articles and SDK documentation that go into depth on this subject. I definitely recommend ovaj site.

</kraj>

Pretplatite se na moj blog.

Technorati Tags:

3 misli o „Brzo i jednostavno: Pružanje Web Site Korištenje SharePoint Object Model u 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
    Bok,
    Nemojte zaboraviti o zbrinjavanju predmete nakon što ste učinili s njima. Tendenciju da se prilično resurs svinja ako netko ima mnogo prilagođenu aplikaciju gdje se ne uzeti odlaganje predmeta u obzir, pogotovo ako ima puno istodobnih korisnika.
    Ovaj članak opisuje MSDN odlaganje predmeta prilično dobro, and takes up some examples of where the resources tend to run low if you forget about disposals 🙂
    Ja obično ne sviđa;
    pomoću(SPSite someSite = new SPSite(http://litware.inc/)){
    //Do stuff here
    }
  3. No name
    WSS SDK sadrži mnogo primjera. Razmišljanje u smislu SharePoint Object Model stvarno pomaže sam saznala. Kao što su web-mjesta pohranjuju u zbirci web-mjesta te će tražiti posjed SPSite koji sadrži stranice (SPSite.AllWebs). Budući da ova kuća je skup tipa SPWebCollection što bi otići tamo i saznala različite verzije Add metode uključujući isječak koda.

Dopust jedan Odgovor

Vaša email adresa neće biti objavljena. obavezna polja su označena *