Saturday, May 7, 2011

Specified value is not supported for the parameter.

Yesterday I was trying to create a new web application in SharePoint 2010 and I got this error:
"Specified value is not supported for the parameter."
I was wondering which parameter is talking about, I tried to check my values in "Create new web application page but every thing seems to be OK. So, I just looked in Event Log to see is there any other information that I can find and result was No, Nothing!!

Finally I just tried to search for it in web and thanks to google and Sathish TK blog post I got the reason: "SharePoint actually checks whether the machine (user account too) is connected to the domain before these actions are completed. This happens to machines that are part of the domain during SharePoint install and configuration."

Saturday, August 28, 2010

SharePoint 2010 Persian Calendar

Every one who is interested in Microsoft SharePoint 2010 Persian Calendar can have now!
Finally Honopardaz development team successfully developed Persian Calendar for SharePoint 2010. The final tests are done and its ready to be published for people who need Jalali Calendar on SharePoint.

You can find some screen shot at Honopardaz official website or http://www.sharepoint2007.ir.

Sunday, June 20, 2010

Installing SharePoint 2010 on Windows 7

A great post from Dahnesh's Blog.
 
Some of you may want to install SharePoint 2010 or SharePoint 2010 Foundation on Windows 7 for development and testing purposes. I have also managed to do so and thought I would quickly share some of the key steps for this setup.

Firstly, the article I referred to for this setup is here and here are the steps I followed:

1. Ensure that you have Windows 7 x64 edition and SQL Server 2008 R2 x64 installed on your . The SQL Server 2008 R2 installation can be the Developer Edition or the Express Edition, whichever is relevant in your case.

2. Copy all the SharePoint setup files to c:\sharepointfiles folder and then open the config.xml file from c:\sharepointfiles\files\setup using notepad. In this file, add the following line

<Setting Id="AllowWindowsClientInstall" Value="True"/>

Ensure that you add this line anywhere between <Configuration> and </Configuration> tags. Save the file after you add this line.

3. Install the following components

    a. Windows Identity Foundation (Click Here) – Install the "Windows6.1-KB974405-x64.msu" file

    b. Chart Controls (Click Here) – not required if you're planning to install SharePoint 2010 Foundation

4. Install the required "Windows Features" by pasting the following text in the command prompt and then press "Enter" (ensure that this is a single line, no breaks) – better way is to paste this in notepad and ensure that "word wrap" is off and then paste this into the command prompt.

start /w pkgmgr /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-ApplicationDevelopment;IIS-ASPNET;IIS-NetFxExtensibility;IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-HttpTracing;IIS-CustomLogging;IIS-ManagementScriptingTools;IIS-Security;IIS-BasicAuthentication;IIS-WindowsAuthentication;IIS-DigestAuthentication;IIS-RequestFiltering;IIS-Performance;IIS-HttpCompressionStatic;IIS-HttpCompressionDynamic;IIS-WebServerManagementTools;IIS-ManagementConsole;IIS-IIS6ManagementCompatibility;IIS-Metabase;IIS-WMICompatibility;WAS-WindowsActivationService;WAS-ProcessModel;WAS-NetFxEnvironment;WAS-ConfigurationAPI;WCF-HTTP-Activation;WCF-NonHTTP-Activation

5. You can now run the Setup.exe from the SharePoint installation files and proceed as a normal installation

You can also refer to the article I mentioned earlier (here) from which I have successfully installed SharePoint 2010 and SharePoint 2010 Foundation on Windows 7 x64 (Enterprise Edition).

Friday, June 18, 2010

Visual Studio 2010 SharePoint Power Tools

The Visual Studio team that brought you the SharePoint developer tools in Visual Studio 2010 is happy to announce we have created a set of power tools that make developing SharePoint 2010 sandboxed solutions even easier.  Below is the list of features included in the current release of the power tools.

Sandboxed-compatible Visual Web Part 

This item template enables you to use a visual designer to create SharePoint web parts that can be deployed in a SharePoint 2010 sandboxed solution.

Sandboxed Compilation 

This extension displays build errors when you use types or members in a SharePoint 2010 sandboxed project which are not allowed in the SharePoint sandbox environment.

The Visual Studio 2010 SharePoint Power Tools are available immediately on the Visual Studio Gallery.

VSeWSS Import Tool for Visual Studio 2010

SharePoint VSeWSS Import tool is an add-in to Visual Studio 2010 and it adds a new SharePoint project template for importing a VSeWSS project. "VSeWSS or Visual Studio 2008 extensions for Windows SharePoint Services are Microsoft tools for creating SharePoint 2007 projects on VS2008. In VS2010 we've built in tools for creating SharePoint 2010 projects. This import tool takes a VSeWSS project that's targetted at SharePoint 2007 and migrates it to VS2010 where it's targetted at SharePoint 2010.

The import tool is distributed as source code so you'll need to compile it before using it. There's a batch file provided for this and you just need VS2010 installed and to run batch file. The import tool works at the project level, not the solution level. So if you've a solution with multiple projects you'll need to import them one by one and get them all going," revealed Microsoft.

More info and download Url: http://code.msdn.microsoft.com/VSeWSSImport

Saturday, June 5, 2010

Microsoft Sharepoint – Benefits For A Sharepoint Developer

Sharepoint developers today have a vast choice of applications to choose from. One of the best options though is Microsoft Sharepoint. This application has helped Sharepoint developers perform tasks easily and at a much more reasonable cost as the time involvement is also reduced. Microsoft SharePoint helps SharePoint developers to perform tasks related to business applications, corporate search engines, content management systems and business intelligence tools. This application not only helps a Sharepoint developer; but also creates websites and manages web contents. Sharepoint developers can now develop programs for organization to perform across several locations at one place. This can provide a systematic workflow and help organizations perform better. Sharepoint developers can also help employees in an organization share and work together on documents with the help of Microsoft Sharepoint. This application also provides Sharepoint developer's useful business intelligence tools which they can put to use at various levels. The application is very compactable and Sharepoint developers have no problem in interagrating them with Microsoft products such as office, excel, exchange and internet explorer. This helps Sharepoint developers take the concept of the web to a total new level.

Microsoft Sharepoint has taken Sharepoint development to a whole new level and increased the potential of Sharepoint developers. With the increase of Sharepoint taking over almost all industries in the market today; the application has been very popular among Sharepoint developers and has also generated major revenues.

Sharepoint developers now prefer the Microsoft application as this is gaining huge popularity with all industries. Some famous applications Sharepoint developers have created with the application include Congos which is a business intelligence software maker.

This application also has a major scope for improvement and can add some enhancements to it. Sharepoint developers are growing as the Sharepoint market is growing tremendously across the World Wide Web. Sharepoint looks very promising and with applications like Microsoft Sharepoint; Sharepoint developers are beginning to get more and more in demand. SharePoint developers can change the traditional methods into more contemporary and friendly methods due to the help given by Microsoft to SharePoint.

Friday, June 4, 2010

SharePoint Q&A: Microsoft's Arpan Shah

Microsoft on May 12 released Office 2010 and SharePoint Server 2010. You can read the Visual Studio Magazine cover feature here . While the Office launch is certainly notable, the impact of SharePoint 2010 on .NET developers is potentially huge. The combination of Visual Studio 2010 (launched in April) and SharePoint 2010 has transformed SharePoint application development from an often-frustrating challenge into a first-class development experience.

Arpan Shah, director of SharePoint Tools and Technologies at Microsoft, talked with us about the new version and its impact on developers. You can find useful information about SharePoint 2010 training and resources in this blog entry by Arpan Shah. For a bit more on the Office side of the launch, check out this blog entry from Microsoft Senior Product Manager John R. Durant.

Michael Desmond: Microsoft has admitted that it had work to do to get SharePoint-based development up to grade with other platforms. What in your mind were the most critical areas that needed to be addressed to make SharePoint developers first-class citizens in the .NET development space?
Arpan Shah: We've made a number of investments for SharePoint developers across the board. One I would call out is our SharePoint developer tools in Visual Studio 2010 that make it very easy for developers to code and debug SharePoint solutions quickly. In addition, we also support Windows Vista SP2 and Windows 7 as SharePoint development environments. These two investment areas plus many more really bring SharePoint development in line with the other types of .NET development, which is great for developers.

MD: I've heard lots of devs rave about two things that got fixed with Visual Studio 2010 and SharePoint 2010: The ability to develop on a Visual Studio workstation, and the addition of F5 build/debug/deploy. How difficult was it to enable these important capabilities with SharePoint 2010?
AS: We listened to our developer community and prioritized our engineering efforts to enable these key developer scenarios. Support for the Windows client as a developer environment was possible because of the similarity of the IIS codebase in Windows Vista SP2/Windows 7 and Windows Server. It's important to point out that there are limitations when developing on the Windows Client, so we recommend that developers use Windows Server for a full developer experience across all the SharePoint Server 2010 features. Support for Visual Studio 2010 SharePoint Developer Tools was possible because of the partnership with and hard work by the Visual Studio team.

MD: Business Connectivity Services are getting a lot of attention as a key ingredient in the SharePoint (and Office) update. Can you explain why SharePoint oriented developers might want to explore BCS more closely?
AS: Business Connectivity Services (BCS) really takes away the need to do a lot of the plumbing and heavy lifting a developer typically needs to do in order to integrate with another backend system. Developers can use BCS to connect SharePoint 2010 and Office 2010 to databases and/or other line of business (LOB) systems such as Microsoft CRM and SAP to surface data to end users. End users can read, edit and take the data offline. BCS connections can be set up declaratively through SharePoint Designer 2010 as well as developed in Visual Studio 2010.

MD: What are you hearing from .NET developers since SharePoint 2010 launched? Are you seeing SharePoint development shops moving immediately to Visual Studio 2010 and SharePoint 2010 in lockstep?
AS: We are receiving great feedback from the developer community. Visual Studio 2010 and SharePoint 2010 are helping SharePoint developers rapidly develop & debug SharePoint projects reducing overall time-to-market for their SharePoint solutions. With good developer training available, we're seeing SharePoint developers upgrade their SharePoint 2007 skills to SharePoint 2010. Many development shops are starting new projects with Visual Studio 2010 and SharePoint 2010 as well as working with their existing customers to upgrade them to SharePoint 2010 to take advantage of all the investments made.

MD: If you could do the whole SharePoint 2010 cycle over again, what one thing might you change and how?
AS: We have a really great tools story with Visual Studio 2010 and SharePoint 2010, and we know there is more we can do to build on that great experience. Looking back, I think we got the priorities right on what to do first, but it's hard not to look at the additional things we would like to have done and wonder what if. It just gives us more excitement about what will come next!

Redmond Developer News

Tuesday, May 25, 2010

SharePoint 2010 – Top 10 Resources to get you started


With the official launch of SharePoint 2010 last week, we thought now would be a perfect time for us to share some resources to help you to get started evaluating and learning about the new release. 
This post contains links to download evaluation software, guides, demo virtual machines and lots more, for both Developers and IT Professionals.

1. Check out the Office 2010 & SharePoint 2010 Launch Keynote and on-demand sessions, and the SharePoint 2010 Product Site on Microsoft.com
3. Check out the learning plans for IT ProfessionalsDevelopers and End Users and get started on your SharePoint 2010 learning plan.
4. Download the pre-configured Hyper-V SharePoint 2010 Evaluation and Demo Virtual Machine (~1.8GB) along with the SharePoint 2010 Walkthrough Guide for a chance to get hands on with SharePoint 2010 with zero set up and configuration.
5. Download 180 day trial versions of;  SharePoint Server 2010FAST Search Server 2010 for SharePointOffice Professional Plus 2010Windows Server 2008 R2SQL Server 2008 R2 to install and evaluate SharePoint 2010 yourself, and while you're downloading stuff here's some links to the full versions of; SharePoint Foundation 2010Search Server Express 2010SharePoint Designer 2010
6. Watch the Getting Started with SharePoint 2010 for IT Professionals video series and the Getting Started with SharePoint 2010 for Professional Developers video series to get bite-sized video overviews of some of new and updated features.
7. Do the self paced IT Professional hosted virtual hands-on-labs and Developer hosted virtual hands-on-labs to get hands-on with SharePoint 2010 through a series of scripted tutorials, and if you want more, then download and install 10 getting started Developer Hands-on-labs.
9. Visit the TechNet and MSDN SharePoint 2010 sites for a wealth of technical reference documentation and prescriptive guidance through our categorized resource centers, such as the Installation and Deployment Resource Center to learn how to plan, install and configure SharePoint 2010 and the Upgrade and Migration Resource Center for the latest guidance and best practices for upgrading to SharePoint 2010.
10. Got questions?  Search for an answer, or ask the community in the official Microsoft SharePoint 2010 Forums.
 Already a SharePoint 2007 expert?
Check out the free advanced training content for IT Professionals and Developers looking to upgrade their skills from SharePoint Server 2007 to SharePoint 2010.
We've got 36 modules of self paced IT Professional Advanced Training and Developer Advanced Training that includes audio and video recordings.  We'll also be adding 24 hosted virtual hands-on-labs in the very near future to accompany the training content – All for FREE and on demand.
Want to get certified on SharePoint 2010?
Take a look at the Microsoft Learning SharePoint 2010 Training Portal for information and expected availability dates for SharePoint 2010 Certification, Classroom training, E-Learning, MS Press books and Learning Snacks.

Thursday, May 20, 2010

SharePoint 2010 Products Documentation


The SharePoint IT Pro content team announced the release of our Launch documentation for SharePoint Server 2010 and SharePoint Foundation 2010! They have created several different types of content to help you plan, deploy, and administer both SharePoint Server and SharePoint Foundation.
The Launch content for both products can be found here:
SharePoint Server 2010:
  • SharePoint Server 2010 Tech Center is a gateway into the IT Pro documentation for SharePoint Server 2010 and a location for RSS feeds of new content.  
  • Resource Centers provide information across the product lifecycle for activities and solutions.
  • TechNet articles are organized by the product lifecycle – evaluate, plan, deploy, operate, etc. Content includes a newly published page with an RSS feed, so you can keep up with what we've published, and a roadmap to the content.
  • Worksheets are Microsoft Excel files that you can use to record information that you gather and decisions that you make as you plan your deployment of Microsoft SharePoint Server 2010.
  • Models are poster-sized illustrations of Microsoft SharePoint Server 2010 architecture and concepts.
SharePoint Foundation 2010:
  • SharePoint Foundation 2010 Tech Center is a gateway into the IT Pro documentation for SharePoint Foundation 2010 and a location for RSS feeds of new content.
  • Resource Centers provide information across the product lifecycle for activities and solutions.
  • TechNet articles are organized by the product lifecycle – evaluate, plan, deploy, operate, etc. Content includes a newly published page with an RSS feed, so you can keep up with what we've published, and a roadmap to the content.
  • Worksheets are Microsoft Excel files that you can use to record information that you gather and decisions that you make as you plan your deployment of Microsoft SharePoint Foundation 2010.
  • Models are poster-sized illustrations of Microsoft SharePoint Foundation 2010 architecture and concepts.
Be sure to check this space often as we highlight specific content that may be of interest to you and notify you of new content as it's published.
P.S. – Be sure to also check out the following:

Friday, May 14, 2010

Microsoft Office 2010 and SharePoint 2010 Officially Launched


Microsoft [MSFT] has officially launched Microsoft Office 2010 along with SharePoint 2010, Visio 2010 and Project 2010 and made it available to business customers.
If you remember back a few weeks, Office 2010 was first made available to MSDN and TechNet subscribers. This next phase moves one step closer to the full launch that will be see the 2010 product range launching June 15.
Prices of Office 2010 and other software in the suite will range from $99 all the way up to $499 depending on which version of Office you choose.
Updates included in Office 2010 include performance increases making features such as search a lot faster than previous versions. Also improvements to navigation functions have been included along with superior editing tools for video.

Wednesday, June 3, 2009

Don't do that with SharePoint by Paul Galvin


We've all had flashbacks to our childhood when our mothers told us, "Don't do that, or you'll regret it." But then we went ahead and did it anyway, right? As children, we just didn't have the wisdom or foresight to trust that advice. Now that we're older and wiser, we can take those words to heart.
Here are five "don't do that" tips for SharePoint that can save you hours of unnecessary re-work down the road. Not interested in following this advice? That's your decision, but don't say I didn't warn you.
NUMBER 1: Don't change the title on the core item content type.
SharePoint has a Title column on every custom list (FIGURE 1), and it's used throughout the environment. If you rename the Title to something like "organization," you will have the undesired consequence of changing it in more places than you had planned.
FIGURE 1 (click to enlarge)
The problem will show itself very quickly—you'll probably receive phone calls from confused end users within the hour. It is difficult to fix and cannot be done out of the box. Share- Point recognizes the word Title, along with a number of other names, as being special. It will not let you create a column with that name, but itwill let you change the existing core column.
So you can rename the core Title column onMonday. But, when you realize your mistake on Tuesday, SharePoint won't let you fix the problem by setting the core column's name back to "Title" because "Title" is a reserved word. In other words, SharePoint allows you to enter a catch-22 situation and won't easily let you out.
The solution is to use a third-party tool, such as one you'd find on Code- Plex, or to write some C# orVB.NET code and make the correction programmatically. The easiest thing, though, is to save yourself the trouble by never changing the Title column's name.
NUMBER 2: Beware of "publishing site" templates.
If you create a site based on a publishing site template, you cannot save that site as a template (FIGURE 2).
FIGURE 2
More than one SharePoint pro has set out to create the perfect custom template. They do everything the right way: They interview the users and work with them over a period of a week or two to design the ideal custom template. But when they create the site to use as a template, they hit a snag.
Here's the problem: Everything looks perfect, but then you go to save your site as a template so you can reuse it, and can't do it.
FIGURE 3A shows the look-and-feel options for a site based on a publishing template, and FIGURE 3B shows a site based on a collaboration template.
FIGURE 3A 
FIGURE 3B (click to enlarge)
If you've done this to yourself, your best bet is to start over with a collaboration template. Consider using a blank template or possibly a team site template as your starting point. If you want or need publishing features in your custom template, enable them on your site, as shown in FIGURE 4.
FIGURE 4 (click to enlarge)
NUMBER 3: Don't define content types in the wrong place.
Content types fit within the site hierarchy of your sites. Consider the following hierarchy:
Portal
    SubSite A
       SubSite AA
          SubSite AAA

    SubSite B
       SubSite BB

    SubSite C
       SubSite CC
          SubSite CCC
If you define a site content type at "SubSite C," it will be available to Sub- Site CC and SubSite CCC. But it will not be available to SubSite A, SubSite B or their children. There is no easy way to move a Site Content Type around in the hierarchy. If you make this mistake, your only alternative is to delete the Content Type and recreate it at the right position in the hierarchy.
Deleting a content type can be drastic and—very possibly—impossible as a practical matter. Once content such as documents orWeb pages use a Content Type, you cannot delete it. The most important lesson to draw here is that a well-thoughtout information architecture is vital for a healthy SharePoint environment.
NUMBER 4: Don't expect to rescue SharePoint Designer workflows.
SharePoint Designer is a friendly wizard that allows properly trained business analysts to create workflows. Companies leverage these workflows to solve a wide variety of business problems. But, a SharePoint Designer workflow has a major technical limitation that escapes the notice of many first-time SharePoint users: It is always tied to a specific list.
Many times, organizations define multi-step workflows that solve business problems common to multiple teams and divisions within a company. Wouldn't it be great if you could design and implement a workflow in one list and then just drag and drop the workflow to another list in the environment? It might be, but you're out of luck.
There are some highly technical methods to get around the reuse problem. But, the time required to create a technical solution is just not worth it.
NUMBER 5: Workflow history is not an audit trail.
This is an insidious issue because you would never notice the problem until it's far too late. For example, an auditor is tapping you on the shoulder, asking you to demonstrate when a particular financial document was approved and by whom. You go to the workflow history and it's empty. Why? By default, SharePoint purges workflow history after 60 days.
There are several ways to address this problem: You can disable the job that does the purging (FIGURE 5). You can change the purge interval using the stsadm command line program. Or you can write your own audit mechanism. SharePoint Designer can write critical auditable events to a custom list.
FIGURE 5 (click to enlarge)
The best choice is to leverage builtin auditing, possibly with a third-party tool that specializes in audit reporting in a SharePoint environment.
So there you have it. Now you know what not to do.
Some of these SharePoint pitfalls are relatively easy to overcome, such as picking a publishing template as a base for your own custom templates. Others are not.
And for those, you may have to start over. Use these tips to avoid these traps, and you'll have a more stable and productive experience with SharePoint.
Paul Galvin is a Microsoft SharePoint MVP and a SharePoint solutions architect at EMC Corp. Galvin has worked in the IT industry for more than 15 years in such areas as software development, consulting and SharePoint solutions design, where he works with clients to create business solutions using the SharePoint platform. He contributes to the SharePoint community through MSDN forums and his blog at http://paulgalvin.spaces.live.com.


Monday, June 1, 2009

Study recommendations for Sharepoint Exam (70-542)


Paul Galvin has prepared a nice list of links which is quite useful in preparing for Sharepoint certification exam (70-542 Microsoft Office SharePoint Server 2007 - Application Development).


http://paulgalvin.spaces.live.com/blog/cns!1CC1EDB3DAA9B8AA!192.entry

Tuesday, May 26, 2009

Working With the ANTS Profiler to Optimize SharePoint by Shereen Qumsieh


Background

Before I get into any detail about this particular problem and its eventual resolution, it might be helpful to provide a little background information about why we're doing this and how we got here. 
Windows SharePoint Services 3.0 (WSS 3.0) provides a very extensible solution platform for the professional Microsoft .NET developer and is becoming increasingly more popular among companies looking to build collaboration and workflow into their environment.
I have been working on a project for the past couple of weeks that consists of a Windows SharePoint Services 3.0 small server infrastructure and several custom application pages written in ASP.NET C# via the SharePoint Object Model. 
The focus of this post will be a small subset of what has been built to date. We'll call this piece the Master Data List. This Master Data List was created as a standard Custom List in SharePoint with several new columns created for the purposes of collecting data relevant to active projects for this department. It was decided early on that the standard newform.aspxeditform.aspx and dispform.aspx pages that come by default with the instantiation of a new list were not going to be sufficient for the purposes of this list. There were several reasons for this:

  • We wanted to dramatically change the layout of the page, including background colors on specific sections, fonts, hyperlinks etc.

  • We wanted complete controls over the types of validation we were doing

  • The page itself was to consist of some aggregated data, in the form of drop downs and data grids, that was being pulled from several different lists within the same site and presented on the editform.aspxand dispform.aspx pages

Problem

Because of the complexity of these pages and the amount of aggregation we were doing, the average loading time for the edit and display forms was about 30 seconds (give or take a few seconds). The objective of this performance evaluation was to bring down the total time for page load to less than 10 seconds which would be a more reasonable end user experience.

Solution

I did manage to eventually bring down the loading times to under 10 seconds, so a 70% increase in performance, with several different techniques which I will now discuss in some detail.
  1. The first thing I did for both the editform.aspx page and the dispform.aspx page was to remove all <asp:Label> objects and replace them with plain text. If I wasn't planning to manipulate the label object in any way in the code behind, there was no need to create a control of this type. Text was sufficient for these purposes.
  2. The second thing I did was to remove all Telerik textbox and combobox controls except where required and converted them to asp:dropdownlists and asp:textboxes.
  3. The third thing I did and the focus of this article was to leverage ANTS Profiler to find areas in my code that required optimizing. I am going to talk about this in some detail to outline my approach to doing this and how this helped with the performance tuning.

Configuring ANTS Profiler to work with SharePoint

To get started, you'll need to have some sort of development box already in place where your code has been deployed to. In my specific example, I had WSS 3.0 installed in a single server scenario, with all of my custom application pages stored in the _layouts directory.
Download and install the ANTS Profiler from here. They offer a free 14-day trial that will be enough to get you going. I really do recommend that any serious SharePoint developer or .NET developer have this tool in their tool belt.
Once the profiler is installed, RedGate has provided us with a really handy guide for setting up SharePoint to work with the profiler: http://www.red-gate.com/support/Knowledgebase/ANTS_Profiler/AP4SharePoint.pdf
I won't say much more on the installation steps for ANTS Profiler as they're pretty straight forward.
Once everything has been installed and configured, you can launch the ANTS Profiler. The following is a screenshot of what my profiler page looks like initially:
The above configuration was copied directly from the pdf I'd mentioned above. 
If you're comfortable with the settings, click on Start Profiling to get this going. If you encounter an error similar to the screen shot below, make sure the web site on the port you're trying to profile is stopped. ANTS Profiler needs to be able to launch the site on its own, so you can't have it running while attempting to do this. I run into this now and again when I forget to do that.

Working with ANTS Profiler to track down problem areas

Once the profiler has finished loading, you should now have a default window open to the root of your SharePoint web site.
After this page successfully loads, you'll notice that the profiler has already started gathering data on the initial page load of the SharePoint site. What you'll want to do next is navigate to page you're attempting to optimize. In my example, I type the following:
Hit enter, and the profiler will begin to do its job. Typically I wait for my page to load successfully and then I stop the profiler and begin to do the work of analyzing the results.
As you can see in my screenshot above, I have highlighted the region in the profiler that I want to analyze. If you pay attention when your page loads, you'll get a general idea of where you want to highlight in the time window. Looking at my page above, I can see immediately where the HOT regions are. These are the places I need to pay particular attention to immediately.
To show the source code, I click on the method I'm interested in. In my example, since the slowdown was primarily on Page_Load, that's what I want to drill down into. If I click on theASP._layouts_motorola_not_optimized_aspx.Page_Load method, my screen will refresh with a code view of my page:
The really neat thing about the ANTS Profiler is the way that the scroll bar on the right highlights in RED my problem areas so that I can jump to that part of the code quickly. One of the pieces I was able to optimize was myPopulateDropDownLists method that I had written. Using the profiler I noticed the following bit of code was taking over a second to load:
It would appear that the getDDLNames method, another method I had written, was taking a bit longer than it should to run. Further investigation showed that the reason for this came down to calls to theSPSecurity.RunWithElevatedPrivileges method taking on Page_Load 1.5 seconds to run. Since the SPSecurity.RunWithElevatedPrivileges method is a part of the SharePoint Object Model and not something I had written, I really couldn't optimize that method, I had to come up with a better way to limit the affect it had on my performance.
Within the PopulateDropDownLists method, I was populating a total of 8 drop down controls, each making a call do the getDDLNames method. This was resulting in a huge performance hit simply due to the number of times I was calling SPSecurity.RunWithElevatedPrivileges. I was able to improve the performance of this page by eliminating the getDDLNames method entirely and moving the elevation code up to thePopulateDropDownLists method and making a single call for all 8 drop down lists. As you can see, working with a tool like this makes it really easy to see into areas of your code that you might not have otherwise suspected for the slow down.
I also spent a bit of time going through other areas of my code where this elevation call was being made too many times. I consolidated all areas that required elevation into a single elevation block.
I used the profiler in other areas to optimize code that was not dry enough, and to remove methods that could be architected in better ways. I found that by going through the profiler results and comparing to the code optimization practices found in this document: http://msdn.microsoft.com/en-us/library/bb687949.aspx. I was able to find several areas that needed optimizing.
Take a look at the example below:
SPFieldUserValue user = new SPFieldUserValue(web,Convert.ToString(listItem["Employee"]));
            peEmployee.CommaSeparatedAccounts = pmaUser.LookupValue;
If we have a SPFieldUserValue object, calling upon the LookupValue property will return the Name of that user. This is not to be confused with the LoginName property. Assigning that to the CommaSeparatedAccounts property may do the trick and will load that user account into the control but not without a performance hit.
A better approach would be:
SPFieldUserValue user = new SPFieldUserValue(web,Convert.ToString(listItem["Employee"]));
peEmployee.CommaSeparatedAccounts = pmaUser.User.LoginName;
The difference is minor. Instead of using the LookupValue property, we leverage the SPUser object and call upon the LoginName property. In all of my testing, I noticed an improvement in speed when using the LoginNameproperty.
Depending on your environment, the output from either of those properties will differ and that's the heart of the performance issues. In my environment, LoginName and Name outputted the following:
Name - "Joe User"
LoginName - "domain\juser"

Results/Conclusion

Using a combination of all the techniques I've described above, I was able to dramatically reduce the load time of this page and increase performance to the point where users are happy. Going forward, I was able to gain valuable insights into what aspects of the object model take time to load and therefore require careful planning before implementation.
Original Post on Simple-Talk.com 

Tuesday, May 19, 2009

Add Google Analytics to a SharePoint Publishing Site





From weblog of MIKE KNOWLES
Google Analytics is a web traffic and demographics reporting service provided free of charge by Google. Google Analytics functionality can be added to any web site by setting up an account and adding a snippet of JavaScript to every page within the web site. Once configured you can see all types of statistics such as how users were referred to your site, number of hits per page, where your users are located geographically, what types of browsers and OS they are using, and much more.
This post outlines how to add Google Analytics to a SharePoint Publishing site. You must have edit rights for all site Master Pages. Google Analytics can complement the Usage Reports available to Site Collection Administrators and Search Term Reports available to Shared Service Provider Administrators. Analytics can also be used to provide read-only access to users who do not have administrative rights on the SharePoint site but whose job function might benefit from access to detailed site usage data.

Click here to read the rest of the article:
http://mikeknowles.com/blog/2009/05/17/AddGoogleAnalyticsToASharePointPublishingSite.aspx

Sunday, May 17, 2009

All about Sharepoint 2010



All about Sharepoint 2010 from weblog of Vasmi Krishna:


  1. SharePoint 2010 will be 64-bit only.
  2. SharePoint 2010 will require Windows 2008 or Windows 2008 R2
  3. SharePoint 2010 will require 64-bit SQL 2008 or 64-bit SQL 2005
  4. Internet Explorer will not be supported in SharePoint 2010. The Tier 1 browsers will be IE 7, IE 8 and Firefox 3.x on Windows platform

So, what can you do today to get into the best shape for SharePoint Server 2010?
  1. Start by ensuring new hardware is 64-bit.  Deploying 64-bit is our current best practice recommendation for SharePoint 2007.
  2. Deploy Service Pack 2 and take a good look at the SharePoint 2010 Upgrade Checker that's shipped as part of the update.  The Upgrade Checker will scan your SharePoint Server 2007 deployment for many issues that could affect a future upgrade to SharePoint 2010.
  3. Get to know Windows Server 2008 with SharePoint 2007, this post is a great starting point.
  4. Consider your desktop browser strategy if you have large population of Internet Explorer 6 users.
  5. Continue to follow the Best Practices guidance for SharePoint Server 2007.
  6. Keep an eye on this blog for updates and more details in the coming months.

Wednesday, January 14, 2009

Web Site Design and Positioning

During my last workshop class on ASP .NET we had a review on web page design with ASP .NET. One of the most important part of the design is positioning the element inside you web site. What I recommend is to use <div> and <span> element with CSS styles to position your web pages instead of <tables>. If you look at the many professional designed web sites (like yahoo,msn, ...) and check their source code you will be noticed that most of them are using <div> or <span> for their pages. If you want to know why? "Table vs CSS" is are the reasons.





Now let start with learning <div> and CSS positioning. Just like always I recomend W3Schools. The next one is a reall great weblog from Big John, positioniseverything.net. It's nice blog explaining about positioning with CSS and bugs of browsers.

Sunday, December 14, 2008

Microsoft Security Development Lifecycle (SDL) Optimization Model


The Microsoft® Security Development Lifecycle (SDL) Optimization Model is designed to facilitate gradual, consistent, and cost-effective implementation of the SDL by development organizations outside of Microsoft. The model helps those responsible for integrating security and privacy into their organization's software development lifecycle to assess their current state and to gradually move their organizations towards the adoption of the proven Microsoft process for producing more secure software. The SDL Optimization Model enables development managers and IT policy makers to assess the state of security in development. They can then create a vision and road map for reducing customer risk by creating more secure and reliable software in a cost-effective, consistent, and gradual manner. Although achieving security assurance requires long-term commitment, this guide outlines a plan for attaining measureable process improvements, quickly, with realistic budgets and resources.

If you are intereseted in Microsoft Security Development Lifecycle (SDL) here is some links to it:
The Microsoft Security Development Lifecycle (SDL)
Microsoft Security Development Lifecycle (SDL) – Process Guidance

Monday, December 8, 2008

What is Sharepoint?


During last two month I had many phone calls about Microsoft Sharepoint and related subjects, so I have prepared a little document in Persian about what is Sharepoint, features and advantages. You can download it from my personal web site http://www.tabatabaei.info.

If you need any further information/assistance, do not hesitate to contact me.

Download url: http://www.tabatabaei.info/sharepoint.aspx

Wednesday, December 3, 2008

Value of Selected CheckboxList Item in Javascript

Sometimes, you may need to find which item of your CheckboxList is selected and get it's value on client. Normally ASP .NET CheckboxList does not send its item 's value to client. So if you want to have it, you have to added it your self. In this post I 'm going to show you a simple way to get selected checkbox list item 's value.

First I prepared a checkbox list with some items. In this sample I have added some item manually but you can do this using DataBinding.

<asp:CheckBoxList ID="CheckBoxList1" runat="server" RepeatLayout="Table">
    <asp:ListItem Text="Test" Value="110" />
    <asp:ListItem Text="Test2" Value="220" />
    <asp:ListItem Text="Test3" Value="330" />
    <asp:ListItem Text="Test4" Value="440" />
</asp:CheckBoxList>

Next, I have to add items value as an attribute for the items:

protected void Page_Load(object sender, EventArgs e)
{
     foreach (ListItem li in CheckBoxList1.Items)
         li.Attributes.Add("mainValue", li.Value);
}

Finally, you need to assign a function as click event handler for items. The point is that you can not do it just like the other html element on your page. So I will write a few line of code to add this event handler.

<script>
    function AddHandler()
    {
        var tbl = document.getElementById('<%= CheckBoxList1.UniqueID %>');
        for(var i=0;i<tbl.cells.length;i++)
        {
            var cell = tbl.cells[i];
            cell.childNodes[0].onclick = function ()
            {
                if(window.event.srcElement.checked)
                    alert(window.event.srcElement.parentNode.attributes["mainValue"].value);
            };
        }
    }
    </script>

Notice that I will call this function ("AddHandler") on onload on body.
<body  onload="AddHandler();">

The only thing that you have to be carefull is that this codes will work when you are using CheckboxList with RepeatLayout property is "Table".
Download the sample code from here:
http://www.tabatabaei.info/csharpsamples/EventArgsSample.rar