Pages

Monday, October 31, 2011

How to find a control in a DataList?


How to find a control in a DataList?

Because DataList is databound control which repeats its item template as many times as there are rows in the data source. Therefore contents of
So, to locate a specific Label control, you’d first need to locate a specific dataList item, and run FindControl to it (for example DataList1.Items(0).FindControl(“label2″) ), and considering the databound nature, you’d probably want to loop through all items in the DataList’s Items collection to get to the every Label control.

VB
For Each dli as DataListItem in DataList1.Items
Dim currLbl As Label=DirectCast(dli.FindControl(“label2″),Label)
    '…
Next


C#
foreach(DataListItem dli in DataList1.Items)
{
Label currLbl = (Label) dli.FindControl(“label2″);
//…

}

Tuesday, October 18, 2011

Postback Event when using SharePoint:PeopleEditor

I'm using the SharePoint PeopleEditor to select a user and when the user is selected I want to populate a few fields with information about that user, I get the data from a Database. The problem is, how to make the PeopleEditor send a signal to my code that a value has been set?! There is no event on the PeopleEditor control fires when a value is set.

few minuites of googling lead me to msdn   this article  ,
When you set the property AutoPostBack to true,  a Postback will be generated when a value is set in the control.

In the case of the PeopleEditor this means that when you type a username and click Check names (or hit enter) or use the Addressbook to select a user you will receive a generic postback, and the page is reloaded. There you can have a code in Page_Load that checks if a value has been selected and take some action like querying that database with the PeopleEditor user as a key and then filling other controls on the page.

string accountName = null;
if (peUser.ResolvedEntities.Count > 0)
 {
      PickerEntity entity = (PickerEntity)peUser.ResolvedEntities[0];
accountName = entity.Key;
      int pos = accountName.IndexOf('\\');
      accountName = accountName.Substring(pos + 1);

// take some action based on accountName


 } 

Saturday, September 10, 2011

Tricks for Coding Pages to be Printing Friendly

One day @work, I was asked to make a printOut page version to allow the user to print a Report out of a page filled with lots of data, placed in different sections and tables.. I had to find a way to make the page as much user friendly with its search area and other query controls and to look as a properly designed and arranged report.  
Designing suchpage is actually a joyless task with lots of obstacles, but I must fight to keep my face straight with my managers..

How to Fix Lightbox Effect for Blogger

Last week, I noticed a link to the updated Blogger interface at the top of the page. To tell the truth, I didnt like it at first.. and I couldn't work with it.. I changed it back to the old interface many times.. till I finally got used to it... I also used the new template designer to update My blogger design: colors, Background, Font..  etc.

Anyways, I then started to make a new post when I suddenly noticed... LIGHTBOX EFFECT IS NOT WORKING :O

yah it's normal as I have updated theblogger template , so I must re-followed the steps to add the LightBox effect from my previous post "How to add Lightbox effect to Blogger".. but it was still not working :(

here in this post I will show you How I fixed it using the same Script and CSS files in my previous post.
LightBox Effect



Wednesday, September 7, 2011

How To: Re-Lock Your Motorola XOOM

In this post I'll be showing how you can Re-Lock Your Motorola XOOM in few simple and easy steps...

Sunday, August 28, 2011

How to Fix pop-overs from overlapping embeded flash ?

The Problem:
When using  “modal popup ajax control”, it is overlapped by flash elements.


Thursday, August 18, 2011

How to add Lightbox effect to Blogger


in this post i will show you the steps to add The Lightbox effect to Blogger (blogspot) blogs that is useful when your post has many images or images with large sizes, it helps people to save time browsing images in an impressive way.

LightBox effect

Sunday, June 5, 2011

Friday, April 8, 2011

YouTube Channel


Ok..
So Today.. I activated My YouTube Channel.. changed its Background..