adsense

Wednesday, March 31, 2010

Iterate through Enum values

Here is the enum definition

public Enum Employee
{
  Manager=1,
  Lecturer=2,
  AdminOfficer=3
}

Here is the iteration of Enum
foreach ( int val in Enum.GetValues(typeof( Employee)) )
{
  strin text=Enum.GetName( typeof(Employee),val); // gets Manager,Lecturer....etc
   Console.WriteLine(text + " value" + val.ToString()); //val is the actual value in Enum 1.2....etc
}

Tuesday, March 30, 2010

Set tooltip at the controls like Checkbox list or list items ?

These controls doesn't have  a property to directly set a tool tip. In such cases following code can be useful

int i=0;

foreach (ListItem li in checkboxList.Items) {

 li.Attributes.Add("title","Tooltip " + i.ToString());
 i++;

}

Happy Coding ...!!!

Thursday, March 18, 2010

Google Adsense Terminology

Page impression: A page impression is generated every time a user views a page displaying Google ads. We will count one page impression regardless of the number of ads displayed on that page. For example, if you have a page displaying three ad units and it is viewed twice, you will generate two page impressions and six ad unit impressions.

Clicks:# The number of times an ad was clicked on in the given reporting period.

Page CTR (Clickthrough Rate): The number of ad clicks divided by the number of impressions for the page of ads that appears when a link unit is clicked.

Page eCPM (Effective Cost Per Thousand Impressions): Calculated by dividing earnings by number of page impressions and multiplying. This makes it easier to compare multiple sites to see which are performing better.

Earnings: Total revenue earned to date. More detail about earnings is available in the AdSense Help Center.