I would like to add an item into a picture Library using c#. This is how I would add a field to a normal item:
var item = list.Items.Add();
item["Title"] = "Item title";
item.Update();
How would I go about adding the picture? The picture is stored on the file system i.e. c:\myfile.png I iamgine I need to use SPFile but not sure how.
...
Hi
Can anyone tell me why a masterpage applied to a MOSS publishing site does not get applied to any non publishing pages within the same site - very strange behaviour?
...
Can we use SPSecurity.RunWithElevatedPrivileges in SharePoint timer jobs?
Under whose identity will the timer job run under elevated privilegs?
Any gotcha's and must know facts regarding this will also be appreciated.
...
I have some code that inserts a list item into a list...
I then have this code
SPFolder folder = web.Folders["Lists"].SubFolders[list.RootFolder.Name].SubFolders["Attachments"].SubFolders[item.ID.ToString()];
foreach (SPFile file in folder.Files)
{
string attachmentName = t...
I am writing a web part against a list. The first thing I do in the web part is verify that my custom event receivers are registered on the list. If they are not, I register the programmatically.
I have noticed that if I try to register an event that is already registered, I get no errors and no “Extra” events are registered.
My ques...
I am trying to add the Web Parts to Page Instance of the Page Layout using a Feature.I know it should be through AllUsersWebPart element .I could find the reference of adding a Default Web Part to Page Layout (PortalLayouts feature does it). Also I have seen same in onet.xml . I wanted to know if it possible to create an instance of the ...
I have this CAML (lol thanks to Alex)
query.Query = @"<Where><Eq><FieldRef Name='MessageID' /><Value Type='Text'></Value></Eq></Where>";
This checks if the value of MessageID = string.empty()
What I would like to check for is null.... not empty string...
Is this possible with CAML?
...
My SharePoint site uses Active Directory authentication. The Site Visitors SharePoint group contains the AD group of all users.
I have a subsite which Site Visitors have Read access to. Inside this subsite, I have a document library which I don't want visitors to have read access to and so I have made the permissions unique for this do...
I'm building a new Intranet Portal with SharePoint 2007 that will have News, Site Directory, and Search. Because I want to invest some serious time into customizing and tuning search, I would like to learn whether it is possible to have the Intranet Search live in its own top-level site collection? That would allow me to isolate and ba...
Is there a way to extend the SPGridView control in a webpart such that a user can select the columns that they want to display? Kinda like when creating/modifying a view for a list?
Thanks
...
I am inserting items into a Sharepoint list using C# and accessing the lists.asmx web service. One of the fields in the list is a multiple line text field (rich text), and I want to insert line breaks into the field. What characters do I put in the XML request to insert a line break? Thanks.
...
How would you go about having WSS search index content that's inside a webpart/pulled from an external source and presented in a SPGridView?
...
Usually I use this piece of code to retrieve the content of a folder in VBA. But this doesn't work in the case of a sharepoint. How can I do ?
Dim folder As folder
Dim f As File
Dim fs As New FileSystemObject
Set folder = fs.GetFolder("//sharepoint.address/path/to/folder")
For Each f In folder.Files
'Do something
Next f
EDIT (af...
I've made a page with with three zones. In onet.xml I have defined three webparts which will be added to the page upon site creation. Is it possible to assign an id to each webpart in onet.xml, or do I need to write a feature receiver which hooks up the connections?
My initial thought was to use on the page itself, but then I need the ...
I'm trying to get only certain items from a SharePoint list. The RSS feed is giving me everything, even if I have the list filtered of looking at a specific view.
...
I'm trying to run a search query using Sharepoint search, and I'm trying to grab the GUID of the items within a list (be it in the Pages, Documents, or Custom List). Many posts talk about defining a managed property tieing it to ows_UniqueId. The problem I'm having is that I do not see ows_UniqueId as an option in the mapping list wind...
Hi,
I am using an SPGridView to present some data, and have enabled the filtering ability which works very well. Until you choose a particular item in the data to filter on...
The data item in question has an apostrophe in the string( e.g. "this is richards' string"), which causes the post-filter-application page load to die with the ...
Hello,
We want to implement SSO functionality in our organization, but we're not really sure what our options are, and what the benefits / disadvantages for the different solutions might be.
-We have multiple old ASP(Active Server Pages) sites which should use SSO
-We have multiple ASP.net web-Applications which should use SSO
-We wa...
I am new to sharepoint. I have to deploy an application from one server to another server (Test Server). Now I am using solution package to deploy the application. I have one problem in Deploying. In the web.config of the application there are entries like appsetting entries, safe control entries, endpoint entries for our own services an...