Apr
11
2009

Virtual Earth Map Control on SharePoint

James Tsai .Net SharePoint Blog Virtual Earth Map Control

Well, I finally have some free time to play with it. I know, I am two years late on this topic. But I still wanted to see how Microsoft Virtual Earth Map Control can work together with SharePoint, so I created a control that does following tasks

1. Read saved locations from SharePoint List

Read saved locations information from SharePoint list. SharePoint list stores location items with Title, Address and Description fields.

James Tsai .Net SharePoint Blog Address Book SharePoint List

Render all the locations stored in SharePoint list on Virtual Earth Map Control. Virtual earth Map Control is embedded in Content editor web part - there is no need to create a custom web part.

Display custom created panel control (VEMap Control) on Virtual Earth Map Control. It shows the pushpins, location Id and Titles - user click on the pushpin Id in panel control to see the corresponded location on map

James Tsai .Net SharePoint Blog Virtual Earth Map Control View Mode

2. Write to SharePoint List

Display Pushpin Information box when user click on pushpins – information box contains the custom created HTML with Text boxes and Edit/Save/Cancel action links.

Push changed value back to SharePoint list via SharePoint list web service (/_vti_bin/lists.asmx)

James Tsai .Net SharePoint Blog Virtual Earth Map Control Edit Mode

How to do it

Download JavaScript Files

More...

Jan
7
2009

Where do you deploy custom SharePoint web service files to? (.asmx, disco.aspx and wsdl.aspx)

Recently someone asked me to troubleshoot the problem he had with the custom web service he created.

He followed the instructions from MSDN article "Walkthrough: Creating a Custom Web Service" and generated MyWebservice.asmx, MyWebservicedisco.aspx and MyWebservicewsdl.aspx files. He also made changes to contract reference and SOAP address in both disco.aspx and wsdl.aspx to provide the necessary redirection and maintain the URL virtualization.

Web service was deployed to 12\TEMPLATE\LAYOUTS in file system and can be viewed from URL http://<site>/_layouts/MyWebservice.asmx or http://<site>/<subsite>/_layouts/MyWebservice.asmx without any issues.

"Everything looks fine except..." - he said

At this stage I knew what the problem was and his description of the problem confirmed it.

"Everything looks fine except the web service function call returns an incorrect and unexpected result"

Yes, it could be the code logic errors. But I sticked to the one obvious mistake he has made. I told him that "Only deploy your custom web service files to 12\ISAPI (\_vti_bin\) folder unless you know what you are doing"

I have seen this problem many times before from different developers, third party vendor's and IT supports. They all have their own reasons (wrong reasons) for not to deploy their custom web service files to 12\ISAPI.

Why _vti_bin folder

More...

Nov
20
2008

Showing "my links" with QuickLinksMicroView web part - Issues you should know about

Ishai's post - Showing "my links" on a web page has explained how you can use the QuickLinksMicroView web part to show users "my links" on SharePoint web part page.

The web part looked great when I first added it to the web part page, but it wasn't long before I discovered some of "bugs" in this web part. Bugs or by design?

I will show you what those bugs are by using following configurations: Two groups, 6 links in the first group and 3 links in the second group.

James Tsai .Net SharePoint Blog - QuickLinksMicroView Items

Now let's change the default "Number of rows to display" value from 10 to 2

 James Tsai .Net SharePoint Blog - QuickLinksMicroView Configuration

Click Ok and see what it gets us.

1. "Show/Hide additional links" hyperlink will not work without "portal.css" CSS registration

James Tsai .Net SharePoint Blog - QuickLinksMicroView No Portal CSS

As you can see there is a "show 4 additional links" hyperlink at bottom of the first group (Don't worry about the second group for now, I will get to that later).  Click on the link toggles the display text (hide/show 4 additional links) without change the number of displayed items in group (no actual hide or show for additional items).

The problem here is More...

Oct
27
2008

How To Create AJAX-enabled SharePoint Web Part with UpdatePanel and UpdateProgress in 10 minutes

In this post I am going to show you how you can setup your SharePoint site to support Microsoft ASP.NET AJAX framework and create a basic AJAX-enabled SharePoint Web Part. You can find many great articles on MSDN on how to do these and they explained in more details, but if you are looking for a way to get it up and running in 10 minutes, this is it.

James Tsai .NET SharePoint Blog - AJAX enabled webpart 

James Tsai .Net SharePoint Blog - AJAX enabled webpart updating

An AJAX-enabled web part with update button and display current time every time when button is clicked. Loading image and text displayed during the update.

Goal

  • Enabling SharePoint site with ASP.NET AJAX framework support
  • Create AJAX-enabled SharePoint web part
    • with UpdateProgress control for visual feedback in browser when web part is updating
    • with AJAX request event script to hide UpdatePanel while web part is updating
  • Add AJAX-enabled web part to page and see it in action

More...

Oct
9
2008

How to change SharePoint Calendar default start hour and end hour of Day View

Default Day View of SharePoint Calendar control has its start hour set to 7am and end hour to 5pm.

James Tsai .Net SharePoint Blog - Default Day View Start Hour

To change this you'll need to update SPRegionalSettings.WorkDayStartHour and SPRegionalSettings.WorkDayEndtHour properties. And it is not something you can do from UI.

For example, to change start hour to 6am and end hour to 6pm you'll have to write and run this code

using (SPSite site = new SPSite("http://<YourSiteUrl>"))
{
    using (SPWeb web = site.RootWeb)
    {
        SPRegionalSettings regionalSettings = web.RegionalSettings;
        regionalSettings.WorkDayStartHour = 360;
        regionalSettings.WorkDayEndHour = 1080;
        web.Update();                  
    }
}

 

The possible values you can set for WorkDayStartHour and WorkDayEndHour are 60 x (hour value in 24 hour format).

Basically, they are total number of minutes. For example,

6am = 6 x 60 = 360

6pm = 18 x 60 = 1080

9pm = 21 x 60 = 1260 and so on..

As you can see, the start hour of Day View in calendar has now changed

James Tsai .Net SharePoint Blog - Changed Day View Start Hour

Hope it helps

-James

James Tsai

Blog Disclaimer