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
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. :)
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 Opera Mobile Emulator.
Want to know more, Check this Article.
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.
- Go to the screen you would like to create a screenshot.
- Now hold down Home button and press the power button until you hear a sound something like camera click sound.
- Captured screenshots will be stored in “Screen Captures” folder and you can view them in “Photos & Videos” app under Apps tab in your TouchPad.
- To transfer files, you need to plug the TouchPad into your computer and turn on USB drive mode or you can email to yourself.
- That’s it. Simple ha…
Blogger Template Design
I found a nice article on How to design your own custom blogger template? here
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.
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.
Connected Web Part Approaches
I found a very nice article about Connected web parts.