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


Top 5 Contributors of the Month
Easy Web
Imran Ghani
Post New Web Links

site.Workflowmanager.StartWorkflow with elevated privileges

Posted By:      Posted Date: October 07, 2010    Points: 0   Category :SharePoint
 

I've found this link describing the same problem I got although this article might be related to SharePoint 2007. So after creating a WorkflowAssocciation and adding it to a docLib I'm trying to start the workflow with this code (everything happens programmatically):

SPSecurity.RunWithElevatedPrivileges(delegate
{
  using (SPSite site = new SPSite(SPContext.Current.Site.ID))
  {
    using (SPWeb web = site.OpenWeb())
    {
      foreach (SPListItem item in MyListItems)
      {
        web.AllowUnsafeUpdates = true;

        web.Site.WorkflowManager.StartWorkflow(item, myAssociation, myAssociation.AssociationData);

        web.AllowUnsafeUpdates = false;
      }
    }
  }
});

This is the stacktrace for the errormessage "


View Complete Post


More Related Resource Links

site.Workflowmanager.StartWorkflow with elevated privileges

  

I've found this link describing the same problem I got although this article might be related to SharePoint 2007. So after creating a WorkflowAssocciation and adding it to a docLib I'm trying to start the workflow with this code (everything happens programmatically):

SPSecurity.RunWithElevatedPrivileges(delegate
{
  using (SPSite site = new SPSite(SPContext.Current.Site.ID))
  {
    using (SPWeb web = site.OpenWeb())
    {
      foreach (SPListItem item in MyListItems)
      {
        web.AllowUnsafeUpdates = true;

        web.Site.WorkflowManager.StartWorkflow(item, myAssociation, myAssociation.AssociationData);

        web.AllowUnsafeUpdates = false;
      }
    }
  }
});

This is the stacktrace for the errormessage "

SharePoint Site Access Privileges

  
Hi All,   I am checking to see if anyone has run across a problem with a site losing its access privileges above read-only. I have a couple of sites that used to have the full range of group level access - full control, contribute, approve, etc. However, at some point and I don't know when all these access levels except read-only have been lost. I can no longer do updates, uploads, creates or deletes. I even tried accessing the sites on the web server with the service account and even this user id has read only access to the sites.   The only solution I have found is to create a new site and move all the data to the new site. Does anyone know of a way to restore the access privileges other than this method? Thanks for any help you can provide. Walt

SPList.WorkflowManager.StartWorkflow(SPItem item, SPWorkflowAssociation association, string initiati

  
I want to know initiationData Data format in this method  please help me .I want send some integer to workflow but I dont know initiation data format.??

Getting elevated site in Event Handler

  

Hello,

In ItemCheckingIn and ItemCheckedId event handlers, I need elevated site since I'm deleting / adding new documents.

 

 

 

 

public override void ItemCheckedIn(SPItemEventProperties properties)
{

DisableEventFiring();

try
{
using (SPSite site = SecurityHelper.GetElevatedSite(properties.ListItem.Web.Site))
	{
		using (SPWeb web = site.OpenWeb(properties.ListItem.Web.ID))
		{
			// do some strange things			
		}
	}
}

catch{ }

EnableEventFiring();
}

But according to the best practices, Its a bad idea to instantiate a new SPSite and SPWeb object. (obviously, for performance reasons..)

http://msdn.microsoft.com/en-us/library/bb687949.aspx

 

Since I need elaveted web in both event handlers, I'll have double performance penalty. I was thinking to make us of caching, but SPSite or SPWeb is not thread safe, so cannat be cached..

 

Is there any better way ?


Changing the graphics on the home page of a SharePoint site

  
When you create a site in Microsoft Windows SharePoint Services by using the default Team Site template, the home page includes two default graphics. A Windows SharePoint Services graphic appears in the body of the page, and a picture of a house in a circle appears near the site title. You can change these graphics to customize your site. Changing the smaller graphic requires a Windows SharePoint Services compatible Web page editor

Take a tour of your SharePoint site

  
What is a SharePoint site for?
A SharePoint site is a Web site that provides a central storage and collaboration space for documents, information, and ideas. A SharePoint site is a tool for collaboration, just like a telephone is a tool for communication, or a meeting is a tool for decision making. A SharePoint site helps groups of people (whether work teams or social groups) share information and work together. For example, a SharePoint site can help you:

Coordinate projects, calendars, and schedules.
Discuss ideas and review documents or proposals.
Share information and keep in touch with other people.

Six easy ways to customize your site using Web Parts in SharePoint

  
Becoming familiar with Web Part customization techniques gives you a range of page-customization choices. For example, you can customize your site's home page so that it displays the specific information that your team needs. You can rearrange the list items on the home page, add lists, and even change the images on the home page. As you become more familiar with Web Part Page customization techniques, you can build interactive Web Part Pages that makes the data in lists more dynamic and useful, and you can add new Web Parts that provide access to external data and Web services.

Tips to Improve Your ASP.NET Web site performance

  
ASP.NET has been developed with lots of features which makes developer life easy. Start from ViewState, PostBack, Server Controls , User Controls and etc. All of them can make your web development experience fun and easy, but improper use of them can cause your site performance slowdown. Most of the controls generate overhead to the client and server. Therefore in this article, I I will list out about things you can do and don't to improve your ASP.NET website performance.

SharePoint Application and Site Pages - Part 1 of 2

  
In this first part of the two part series, Steven covers the differences between Site and Application pages in SharePoint 2007, why each may be used in various circumstances, and prepares for the construction of a menu located application page. After a brief introduction he examines the concept of Site Pages and Application Pages separately in detail with supported screenshots.

SharePoint Application and Site Pages - Part 2 of 2

  
As the second article in a two part series, Steven examines the attributes and details of a SharePoint 2007 application page, including the construction and feature deployment of the same page based project. Since this is a WSS level objective, as opposed to MOSS, you will not need MOSS to work with the code included in this project. Windows Server 2003, WSS, and Visual Studio 2005 are all that is needed, with no additional add-ons. He provides a detailed analysis of each step involved in the creation and deployment of the project.

The best site i ever seen

  
See this site and enjoy the feature and designs which as i think you never seen ...

Thanks !!!!

Asp.net web site security database

  

Hello all, I'm new to asp.net and I'm currently practising some few stuffs. I'm creating a hotel reservation system using ASP.net Web site in visual studio 2008 and I currently don't have an App_Data in my solution explorer unlike visual web developer.

1. I have planned to make users of the website login before making their reservations.

2. I have also planned to develop the website such that I will be able to know all reservations made by each user.

First and formost, I will like to know how I can access/View the security database?

Secondly, how do I link my custom made reservation database and the security database in order to achieve my second plan above.?


Someone help me.


Thank you.


Create Web Site vs Web Application

  

I follow the tutorial and creted a web site for my company sales system. One of my collegue mention we use the wrong templet, we should use Web application for company application.


Should i continue using web site or change to web application? We are creating application for company sales, inventory, hr ,etc where possible more than 1000++ user. And during month end, it will be high traffic and transaction. can Web Site Template with BLL and DAL handle it? or i just need a powerful server?



Remove #Region from whole web site

  

Hi All,

I need to deliver source code to client and my boss need to remove all the comments and #region sections from the whole web site source code.

So is there any functionality available in visual studio 2010 or may be in an other 3rd party tool available to do so, which can remove all the #region from all over the source code ?

Otherwise my developers has to do donkey work.... :(( and I don't wish it. 

Any help or tips/tricks would be appreciated.

Thanks


Web Site to Web Application Question

  

I've been building web sites and for my next project I will be creating a web application.  I use a 'BasePage' class in all my projects but, since web applications do not contain the 'App_Code' folder, what is the best place/practice for the 'BasePage' class?

Thanks,

TML


is it possible to convert whole visual studio 2008 web site project to visual studio 2010 web site p

  

is it possible to convert whole visual studio 2008 web site project to visual studio 2010 web site project

 

my current project references

 

 

 

i have a very annoying iis problem

iis server stops working until app pool is recycled

 

i am hoping that new visual studio (net framework 4.0) may solve this very annoying unsolveable problem

 


Problems with Forms Authentication in DD 4 site

  

Hello,  I am seeing a strange problem with Forms Authentication in my DD site.   A user logs into and can view/edit/delete data all day, but when they execute a Custom Filter against data (for example , a control DynamicData/Filters/CustomerLastNameSearch.ascx ) then the site auth fails, and redirects to the log in screen.

in web.config I have

     <authentication mode="Forms">
            <forms name=".Star" loginUrl="~/Login.aspx" protection="All" defaultUrl="~/Default.aspx" path="/" timeout="43200" cookieless="UseCookies" />     
        </authentication>

Offhand, I am thinking two things : that DynamicData/Filters path requires some special handling for some reason, or the control extension ascx is causing auth to get confused.   Has anyone else experienced this or have any suggestions?  Thanks!


Categories: 
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