Monday, October 17, 2011

Could not find UpdatePanel with ID 'XXXX'. If it is being updated dynamically then it must be inside another UpdatePanel

I working on a project where I need to create a connected web parts in SharePoint. I created these web parts and wrap it in update panels. Also I am using the exception handling, so that if any error occurs in the code, I just clearing all the controls in the update panel and created a label control to show detailed error message. Everything works normally (update contents in each web part) if I do not get any error.

But if I get any error in the code, exception shows without any JavaScript error when page loads. Next I made some changes in the filters and hit submit button, now I am getting the JavaScript error as shown below.

Could not find UpdatePanel with ID 'ctl00_m_g_bcc7da50_1d6b_4979_8186_4246cbd7ca34_udpItemListingWebPart'. If it is being updated dynamically then it must be inside another UpdatePanel

image

I couldn’t figure it out what was causing this error for couple of hours. I know there is some thing wrong with the update panel and I closely look into the error message. Since error message says “It is being updated dynamically” and I changed the UpdateMode to “Conditional”.

 

Now It’s working without any JavaScript error. :)

Friday, September 23, 2011

How Does Your Website Look on Different Mobile Phones?

You have web site and want to test in different mobiles to see how it looks?

Here is the solution for you. Use .

 

Want to know more, Check this .

Wednesday, September 21, 2011

How To Take A Screenshot In HP TouchPad

Many of you want to take a screenshots with in their TouchPad for various reasons like show off to your friends, reviews in your blogs, etc., For whatever reason you want, you can do it using your TouchPad without purchasing any screenshot application.

Here is the quick tip which will show you how to take a screenshot in your HP TouchPad and transfer it to your PC.

  1. Go to the screen you would like to create a screenshot.
  2. Now hold down Home button and press the power button until you hear a sound something like camera click sound. HP-TouchPad
  3. Captured screenshots will be stored in “Screen Captures” folder and you can view them in “Photos & Videos” app under Apps tab in your TouchPad.
  4. To transfer files, you need to plug the TouchPad into your computer and turn on USB drive mode or you can email to yourself.
  5. That’s it. Simple ha…

 

Thursday, September 8, 2011

Blogger Template Design

I found a nice article on How to design your own custom blogger template? here

Tuesday, September 6, 2011

SharePoint DateTime Control Date Format

If you are working with DateTime Control in SharePoint, you might have a requirement to show date format (For example DD/MM/YYYY) based on the user regional setting instead of US date format (MM/DD/YYYY)

 

You can specify the regional settings locale id to DateTime local id on Page Load

 

int localId = Convert.ToInt32(SPContext.Current.RegionalSettings.LocaleId); 
dtpcStartDate.LocaleId = localId;


If you want to change the default date format, no matter what the user regional setting is, you can do it my writing the custom control by deriving from the Microsoft.SharePoint.WebControls.DateTimeControl.



 

public class CustomDatePicker : Microsoft.SharePoint.WebControls.DateTimeControl
{
protected override void OnPreRender(EventArgs e)
{
base.OnPreRender(e);
TextBox tb= (TextBox)this.Controls[0];
DateTime dt = DateTime.Parse(tb.Text);
tb.Text = dt.ToString("dd/MM/yyyy");

}

}
}


Note: For above code, I used the Autopostback = true to trigger OnPreRender event until i figure it out how to trigger onDateChangeed event client side.

Thursday, August 25, 2011

How to show dates which has TBD at the end of the SharePoint List?

I am working on the two custom web parts, one of them is filter web part and another one is a results web part which shows data filtered from the SharePoint list based on the user selection. In the filter web part, we have a date range where they can specify certain range or just leave it empty so that we just return records which are greater than or equal to current date. Since dates are not mandatory in my SharePoint list (user don’t have a date and it is TBD – to be decided), it either shows empty dates at the top if i order by dates in ascending order without any filter criteria or it won’t show empty dates if i apply filter criteria.

 

But my requirement is,

  • we should show empty dates (TBD)
  • TBD should be at the end of the result set and not in the beginning of the result set.

To implement this, we created a calculated field and use the following formula

=IF(ISBLANK(DateColumn),DATE(2099,1,1),DateColumn)

 

Where

DateColumn – is a column we used to store the user selected date in the List.

 

Above formula we used max date (01/01/2099), so that we can easily use “Greater than or equal to” to compare with other dates and also sort dates in ascending order so that max dates will so at the end.

 

In the results web part, we are using XSLT to show the data and in that we are checking dateColumn empty or not, if empty show TBD or else show actual date.

 

Hope this helps some one and have a happy programming.

Thursday, August 11, 2011

Connected Web Part Approaches

I found a very nice article about Connected web parts.

Thursday, April 14, 2011

SharePoint 2010 Certification Information

URLS:

http://www.microsoft.com/learning/en/us/certification/cert-sharepoint-server.aspx#tab2

 

Videos

http://channel9.msdn.com/learn/courses/SharePoint2010Developer

Thursday, February 24, 2011

No Edit Page Option in Site Actions in MOSS 2007

Today I tried to Edit the Form pages to add Web Parts, for somehow, i Couldn’t see the option under Site Actions. I found a short cut to edit the page using ?ToolPaneView=2.

For Eg: http://SHAREPOINTSITE/Lists/Test List/NewForm.aspx?ToolPaneView=2

Tuesday, February 22, 2011

Navigate to Web Part Maintenance Page in SharePoint

As most of you know that there are two options to remove web parts from a SharePoint  page.

  • Close – preserves the web part’s configurations and customizations in Closed Web Parts gallery.
  • Delete – deletes permanently.

If you want to see list of all closed web parts on the page, you have to go to Web part maintenance page. However, there is no easy way to get to this page.

 

A quick way to navigate to Web Part maintenance page in both SharePoint 2007 and SharePoint 2010

 

Option 1:

Copy the following code in browser and make changes accordingly,

http://[SERVERNAME]/_layouts/spcontnt.aspx?pageview=shared&url=[Your Web Part Page URL] (For Example: /FirmCalendar/pages/default.aspx)

 

Option 2: (Much easier)

Just append the querystring “?Contents=1” to any page that contains Web parts as shown below,

http://[SERVERNAME]/default.aspx?contents=1

 

Note: In SharePoint Server 2010, a closed Web part no longer consumes the system resources as open Web parts do.

Thursday, February 10, 2011

Error occurred in deployment step 'Add Solution': Exception from HRESULT: 0x81070215

Here I got another error which won’t tell about what the error is. so, i went to SharePoint root folder (14 hive) and checked the log file. Log file contains the following error message

 

Failed to open the file 'C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\Template\Features\WebGTSTemplates\GTSProjectTemplate\onet.xml'.   

 

I Checked the ONET.xml file properties and i found that i forgot to change the Deployment Type to Element File. Once i changed, now i am able to deploy my feature successfully.

image

Hope this helps some one’s life easier. If so, leave some comments.

Thursday, February 3, 2011

Fix Disabled Page Scrolling on Navigation Settings

I don’t know how many of you having issues with Master page branding, i got lot of them and one of them was Navigation (AreaNavigationSettings.aspx) page. When the page renders/load in the browser, it disables the scrollbar even though it has content more than the viewable area and other pages are just fine.

After struggling long time to find out the cause, i couldn’t find any. So, my next option is to search in Google and see any one has similar issue. Likely i found the article from SharePoint Blues which addressing about this issue.

They mentioned about the following workaround which won’t fix the disabled scroll bars instead it hides the #s4-workspace scrollbar (Which is OOB) and shows the browser scrollbar.

$(document).ready(function() {
    $('form[action="AreaNavigationSettings.aspx"]')
        .closest('body')
        .css('overflow', 'visible')
        .find('#s4-workspace')
        .css('overflow', 'hidden');
});

Thursday, January 20, 2011

SharePoint 2010 Branding issue with wide content

I tried to branding my master page and everything works great if the page content is not big enough.

image

But when the page has wide horizontal data, I am having weird issue as show below. Somehow #s4-bodyContainer width is not set to 100%( tried both Min-width and width). Same behavior with default v4.master too.

clip_image004

I found the following hack from the internet to fix the issue.

BODY #s4-bodyContainer

        {

            display:-moz-inline-stack;

            display:inline-block;

            zoom:1;

            *display:inline;

            min-width:100%;

            *min-width:100%;

        }

This one works very well in IE8 but not in IE7. In IE7, second div pushes down.

clip_image006

I am trying to find any workaround for this issue and if i found any i will update this post.

 

Update:

02/09/2011 3:29 PM

I tired the Randy Drisgill master page, Real World Branding with SharePoint 2010 and it shows multiple scroll bars if have more data. Check the following screenshots. I feel, this is not user friendly as user has to vertically scroll down and then select horizontal scroll bar to see the data.

 

clip_image002[6]

clip_image002[4]

Monday, January 10, 2011

Error occurred in deployment step 'Add Solution': Exception from HRESULT: 0x8107026E

I got the following error when i deploying my custom web template in SharePoint 2010 environment.

 

After hours of troubleshooting, i figure it out that WebTemplate Name in the elements.xml has to match with the web template project name. See the highlighted section in the following screenshot. I hope this post will help someone and if so don’t forgot to leave a comment.

 

image

image

Friday, January 7, 2011

How to change default search box size?

By default Microsoft uses the following styles for the input box.

image

 

If you want to modify the width of the input box, you have to do either one of the following option.

Using Custom Master Page: I preferred this option since almost everyone uses there own master page to specify their corporate branding and we can easily override the width by defining custom styles in master page. Add the following code at the end of the Header section

<style type="text/css">
        /* Change the Search box size */
        .s4-search input.ms-sbplain
        {
            width: 500px !important;
        }
    </style>

Using Feature: Choose this option if you are using out of the box master page and desperately want to change the size of search box. Since search box is a delegate control we can easily customize. so i am not going into the details . You will find lot of articles when you search online on this topic and i found helpful as a starting point.