Sunday, 5 January 2014

Visio Services is unable to load

Error Message:

Visio Services is unable to load this Web Drawing because the Web Drawing URL web part setting is invalid. To resolve this issue, verify that the Web Drawing URL is properly formed and refers to an existing .VDW file.

Problem Description:

I found this error while adding visio webpart on SharePoint 2010 webpart page.
I got this error message because at the time of saving visio file  I kept by default extension i.e. “Drawing”.



Solution:

As shown in figure we need to change visio file extension as “Web Drawing”.
The Visio Web Drawing (*.VDW) is a new Visio file type that allows diagrams to be rendered in full fidelity in the browser using Visio Services on SharePoint 2010.

Product applies to:
SharePoint Server 2010


Saturday, 4 January 2014

An unhandled exception occurred in the silver light application

Problem Description:
 An unhandled exception occurred in the silver light application

The site did not allow me creating any new item on one of my sub sites and an error message as “An unhandled exception occurred in Silverlight Application” as in screenshot below.




Steps to solve problem:

1.       Go to Central Administration

2.       Go to Application Management > Manage Web Application

3.       Select the SharePoint Site Collection where you are facing the issue and Click General Settings on the ribbon

4.       Set Web Page Security Validation to “On” and save the changes.




5.       That’s all...Check with your site.

Product applies to:
SharePoint Server 2010
      SharePoint Foundation 2010

Enable anonymous access in sharepoint 2010

In this blog, we learn how to enable anonymous access in sharepoint 2010.
Follow below steps:

1.     Starting in Central Administration, under Application Management, click on the Manage web applications.



2.     Make sure you select the site you want to enable anonymous access and click on the Authentication Providers icon.



3.     On the Authentication Providers pop-up window click on the Default zone.



4.     Under Edit Authentication, check Enable anonymous access and click Save.




5.     Going back to Web Application Management click on the Anonymous Policy icon.




6.     Under Anonymous Access Restrictions select your Zone and set the Permissions to None – No policy and click Save.




7.     Now, web application will allow anonymous access to be set. So, navigate to your top level site collection for the web application. Click the Site Actions > Site permissions.




8.     Under Permission Tools, click Anonymous Access icon and set the permissions to Entire Web site and click OK.







 That’s all...
 Now you should have Anonymous Access enabled.


Product applies to:
SharePoint Server 2010
      SharePoint Foundation 2010




How to add and edit item into the Welcome drop-down menu in Sharepoint 2010


In this blog, we learn about how to add and edit item into the Welcome drop-down menu in Sharepoint 2010.

To add item into the Welcome drop-down menu follow below steps:


1.     Create an Empty SharePoint Project



2.     Updating the Solution Feature



3.     Create an Element : for that we need to create an element to attach to our feature, to do that right-click on the project and add a new item, then choose "Empty Element".



4.     Edit our element to reflect what we needed.

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction
        Id ="CustomMenu_MyProfile"
        GroupId="PersonalActions"
        Location="Microsoft.SharePoint.StandardMenu"
        Sequence="1000"
        Title="My Profile"
        Description="View and Update my Information" 
        ImageUrl="_layouts/images/MyProfile.gif">
    <UrlAction Url="/SitePages/My%20Profile.aspx"/>
  </CustomAction>
</Elements>


5.     Package your Sharepoint Solution

6.     Add and Install your Solution to Sharepoint

7.     Now our menu item is ready, check it out






Product applies to:
SharePoint Server 2010
      SharePoint Foundation 2010


Add a custom button SharePoint 2010 ribbon that executes server-side code


In this blog, we learn about the Microsoft SharePoint 2010 ribbon by adding or removing a custom button that executes server-side code.

To add button into ribbon follow below steps:

1.     Click Microsoft Visual Studio 2010.



2.     On the File menu, point to New, and then click Project.



3.     In the New Project dialog window, in the Installed Templates section, click Visual C#, click SharePoint, and then click 2010.

4.     Click Empty SharePoint Project from the project items.

5.     In the Name box, type RibbonDemo and then click OK.



6.     In the SharePoint Customization Wizard, type the local Web site that you want to use for this exercise (such as http://localhost/SampleWebSite).

7.     For the trust level, select Deploy as a farm solution and then click Finish.




8.     In Solution Explorer, right-click the RibbonDemo node, point to Add, and then click New Item.



9.     In the Add New Item dialog screen, in the Installed Templates section, click Visual C#, click SharePoint, click 2010, and then click the Empty Element item type.



10.  Leave the Name as EmptyElement1 and then click OK.

11.  In Solution Explorer, right-click the EmptyElement1 node and then click View Code.

12.  Delete the contents of the Elements.xml file.

13.  Add the following code to the Elements.xml file.



<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction
  Id="DemoHelloWorldButton"
  RegistrationType="List"
  RegistrationId="101"
  Location="CommandUI.Ribbon">
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition
         Location="Ribbon.Documents.New.Controls._children">
          <Button
           Id="Ribbon.Documents.New.Controls.DemoHelloWorldButton"
           Alt="Hello World Ribbon Button"
           Sequence="10"
           Image32by32="/_layouts/images/PPEOPLE.GIF"
           Command="Demo_HelloWorld"
           LabelText="Hello World Demo"
           TemplateAlias="o2"/>
        </CommandUIDefinition>
      </CommandUIDefinitions>
      <CommandUIHandlers>
        <CommandUIHandler
         Command="Demo_HelloWorld"
         CommandAction="javascript:alert('Hello World!');" />
      </CommandUIHandlers>
    </CommandUIExtension>
  </CustomAction>
</Elements>


14.   In Solution Explorer, right-click the RibbonDemo node and then click Deploy.

15.   Open the Web site specified previously.

16.   Click the Documents tab in the SharePoint 2010 ribbon.




17.   You should see the new Hello World Demo button added to the ribbon.
Click Hello World Demo. The Hello World JavaScript dialog box appears as shown Figure


To remove button into ribbon follow below steps:
1.       In Solution Explorer, right-click the EmptyElement1 node and then click View Code.

2.       Comment the existing code by typing <!-- in front of the opening <CustomAction> element. Next, type --> after the closing </CustomAction> element.

3.       After the commented code, insert the following code.


 
 
<HideCustomAction Id="Ribbon.Documents.New.Controls.DemoHelloWorldButton" Location="Ribbon.Documents.New.Controls._children">
</HideCustomAction>

4.       Deploy and test the updated solution by following steps 1 through 4 in Task 3, Deploy and Test the Solution.


 Product applies to:

SharePoint Server 2010
SharePoint Foundation 2010