.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Can an authenticated user add items to a list anonymously?

Posted By:      Posted Date: September 16, 2010    Points: 0   Category :SharePoint
I have a requirement to allow authenticated users to post items to a list anonymously. The SharePoint site is not enabled to allow anonymous access, so all users will be authenticated. Given that every item that is created in a list will have a Creator, is it possible therefore to impersonate another user? e.g. create an "Anonymous" account and somehow force all new items in a particular list to be created by this account. Perhaps the best way would be to write a WebPart whose UI contains the fields required and then programatically creates the list item as another user (using SPUserToken to get an SPSite object)? If there's a way to do it without code, I'd definitely be interested... Thanks, Alex

View Complete Post

More Related Resource Links

Creating Sites/Lists/List Items under Current User Context in SharePoint By Using SPUserToken

Usually we do this by performing the action under RunWithElevatedPrivileges method and updating the listitem using SPListItem.SystemUpdate() method (see here). but this approach has its own flaws like (RunWithElevatedPrivileges will run under system account, we cannot use SystemUpdate for SPSite,SPWeb,SPList, since it runs under system we will "CreatedBy" by as SystemAccount).

SharePoint 2010 email enabled list with workflow has incorrect User ID when items are emailed to the

I have set up an approval workflow for a document library that has email enabled. Emails come into the document library fine, however, if an item is emailed to the library the workflow kicks off with the initiator as "System Account" rather than the person who submitted the email. This makes the error of "The e-mail message cannot be sent. Make sure the e-mail has a valid recipient." come up. If someone submits a document directly to the library (by logging into sharepoint and submitting) everything works fine. The person submitting by email is a valid sharepoint user and the profile shows the correct email address. The Created by and Modified by fields show the correct person (rather than System Account), it's only the workflow User ID that shows incorrectly if document is emailed to library. Any help or ideas would be appreciated. Thanks

How get the list of user's "i like" items

Hi guys, I would like to retrieve the user's "i like" item. How can I do that? tnx

How do I add user entered item to choice list items programmatically?


Hi friends,

I have been a share point developer for five months and I have a question that how to add user specified values to choice items.

Here  I ill give you the short probelm definition.

I have the list named as "Emloyee list" with two fields, are "Name" and "Offices".

The value for the field is "Name" is to enter bye the user (E.g: Kumar)

After that the field "Offices" is the choice list with the default items("Office1,Office2,Office3..) and the user has selected the option as Office2.

Now the the list has one row of information as

Name         Offices

Kumar        Office1

Like wise we can add the list items.

In the ablove context for the field "Offices" I need to add the choice items dynamically so that the user no need to follow up the asusal strategy that.. By selecting Settings->List itemsettings->selecting column name.. add the 4th choice option like "Office4"..

I hope u understand my requirement.

Can anybody please help me in this regard.

Thanks in advance,



Get pixel format, raw format, property id list and property items image in VB.net - C#.net.

n this simple article you will learn that how we can get pixel format, raw format, property id list and property items image in VB and C#.net.

Get Pixel Format:

Image consists of pixels to get the format of the pixel we have a property named pixel format. This property returns an enumeration of pixel format. This enumeration tells the pixel format.

To demonstrate make a window application. Drag one button and a picture box on form.

Now write the following code on Button click event:

Way of adding items in Drop Down List or List Box using Javascript

The article Way of adding items in Drop Down List or List Box using Javascript was added by raja.s on Sunday, June 06, 2010.

Hi,script type="text/javascript"> function AddItem(Text,Value) { // Create an Option object var opt = document.createElement("option"); // Add an Option object to Drop Down/List Box document.getElementById("DropDownList"

dynamically change html code when user is authenticated


So I have a fairly simple web site which allows an Administrator to edit some data in a database which is displayed on some web pages.

The main navigation on the site is shown in the code snippet below. The Admin link goes to a Login.aspx which allows the Administrator to log in - once authenticated they get sent to the data edit page.

So my question is, how could I dynamically add a link to the data edit page in the <ul> list below once the user is authenticated ?

This would allow the authenticated user to see links to the secure pages in the main navigation bar.

<%--Top Navigation Menu --%>
<div id="topMenu">
<li><a href="default.aspx">Home</a></li>
<li><a href="introduction.aspx">Introduction</a></li>
<li><a href="curriculum.aspx">Curriculum</a></li>
<li><a href="times.aspx">Times & Fees</a></li>
<li><a href="staff.aspx">Staff</a></li>
<li><a href="login.aspx">Admin</a></li>
</div><%--End of topMenu Container--%>
<div id="clear"></div><%--Floats items cleared End of Master Page--%>

How to Customize the Add Comment 'Items on this list require content approval...' notification in


WSS 3.0:

If content approval is turned on, the Add Comment section displays a fairly ugly notification. Is there any way I can customize that section through e.g. CSS or SPDesigner?

I'd like to change at least the text, and preferably the yellow exclamation image, and also the background if possible.

Add Items to List with BDC Column via Web Services

I really hope this is possible.  I am trying to add items to a list that have a BDC column as one of the fields.  Here is the code I am using in the Batch

batchElement.InnerXml = "<Method ID='1' Cmd='New'>" +  
"<Field Name='Title'>Hello World</Field>" +  
"<Field Name='bdc'>BDCIdentifier</Field>&

Display tooltip for Sharepoint list items


Hi All,

I am using MOSS 2007 and my requirement is to show tooltip when I hover the mouse over the title column for each item. I am planning on storing the tooltip string for each listitem in a seperate column. Is there a way to do it. I am sure there is. Any help is greatly appreciated.

Thanks in advance!




Delete list items en masse?

Is there a way to delete list items en masse from a SP list?  I am on MOSS 2007.  In order to use a particular site as a site template I had to save with content and I don't want the content.

Getting user control in NewForm.aspx of the list


I have designed a user control where i have placed some custom fields as per my requirement now my next step is as soon as user clicks 'Create' under Site Settings it should take him to my user control page instead of Newform.aspx default page of the list.Just let me know your suggestions to achieve this as it would help me a lot

Thanks & Regards,


How to Set a list item's createdby or modifiedby field as a User(deleted from AD)



I have to migrate data from SQL DB to SP list. But its old data and some users who created/modified the record has been deleted from the AD. Now I need to set the CreatedBy / ModifiedBy Field of the item accordingly. How to achieve this?

And when I tried to modify the "Editor" and "Author" field through Object Model, it works. But its not working through Webservice. What is the reason behind this?

Please help me find an optimal solution for this...


Thanks and Regards,

/* John JB */

Filter items with a date column with parameters start date and end date on a sharepoint list?

If I have alist with a view that has the columns Title, Status and Status Date and the view has some items. How Can I add a filter with two parameters, start date and end date, to only show records with status date equal to or greater than parameter start date and status date is less than or equal to parameter end date? This is a sharepoint online site and I can't create and deploy custom code, can use SPD though. Do I need to use SPD or is this something I can do in the list settings? Thanks in advance.   Edit: I had a look here http://www.endusersharepoint.com/2009/09/29/sharepoint-date-filter-filtering-a-list-by-greater-than-or-equal-to-date/ but I don't have the Date Filter web part.

Remove items from a list literally not working as needed

This is why SharePoint drives me insane.  Everything I have been able to find on the web says I *can* programmatically remove list items from a list, all I have to do is a declining loop.  I have even copied verbatium several code examples found in this forum and on the web and every last one of them gives me a "Collection was modified; enumeration operation may not execute." error in the Event log.  This is a C# Windows Form Application we want to use to remove a common announcement from any announcement list in our entire site (top down).  We can *add* it to every announcement list without issue (seperate code).  Can anyone point out to us the error in our code below? using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using Microsoft.SharePoint; using System.Text; using System.Reflection; using System.IO; using System.Diagnostics; using System.Xml; namespace RemoveAnnouncement { public partial class RAForm : Form { public RAForm() { InitializeComponent(); } private void removeAnnouncment_Click(object sender, EventArgs e) { const string a = "Application"; try { if (tlsURL.Text.ToString() == "http://" || tlsURL.Text.ToString() == &qu

User Alert Management for a specific list versus entire SharePoint site?

It seems that to be able to manage User Alerts, one must have Full Access to the entire SharePoint site - and then use => Site Settings > User Alerts. Ideally, I would like to be able to grant access to users to only be able to manage alerts for a specific list. Is this possible (without having to do any programming) and, if so, how? If such access is only available at the site level, I will simply create a Permission Level that allows one to only "Manage Alerts" Thanks in advance for any assistance. Dave

External List - Access Selected Items

Hello, The situation;- An external list in SP 2010 from SQL A custom ribbon/button that calls via JS a Dialog box(Application page) and passes the selected items IDs Some code behind to process items after confirmation from user. Question is how to access the selected items in the code behind. As far as I can tell the JS 'getselecteditems' only returns the list ID, which in the case of a standard list is fine, but with an External list returns something like '_B00234' - how do I use this or how to return a more meaningfull ID? (I would rather work in my confort zone VB/C# than JS to process items) casey
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend