Archive for January, 2007

Getting custom data for ItemTemplate within asp:Repeater

Monday, January 29th, 2007
<asp:Repeater ID="Repeater1" runat="server" DataSourceID="NewsDataSource">
  <HeaderTemplate>
    <table style="border-collapse: collapse;" bgcolor="#ffffee" border="0" cellpadding="2">
      <tbody><tr><td>
  </HeaderTemplate>
  <ItemTemplate>
      <p class="Pbullets" dir="ltr">
      <img src="img/bullet<%# getBulletImage(Container.DataItem) %>.gif" border="0"> <a href="page.asp" class="bullets" /><%# Eval("Title") %></a></p>
  </ItemTemplate>
  <FooterTemplate>
      </td></tr></tbody>
    </table>
  </FooterTemplate>
</asp:Repeater>
protected string getBulletImage(object dataItem)
{
  DataRowView row = dataItem as DataRowView;
  switch( int.Parse(row["field"].ToString()) )
  {
  case 1:
    return "A";
  case 2:
    return "B";
  case 3:
    return "C";
  }
  return "";
}

Hot to get an absolute location of the HTML element

Saturday, January 27th, 2007

The function below will give you absolute position of an element in the browser window. This you will need to move element to position relative to another element’s position.

function findPos(obj)
{
  var curleft = curtop = 0;
  if (obj.offsetParent)
  {
    curleft = obj.offsetLeft;
    curtop = obj.offsetTop;
    while (obj = obj.offsetParent)
    {
      curleft += obj.offsetLeft;
      curtop += obj.offsetTop;
    }
  }
  return [curleft,curtop];
}

Remember, when you need to set new position, the value must be in pixels.

toolTip.style.top = new_Y+"px";
toolTip.style.left = new_X+"px";

Protected: Commvault Christmas party

Thursday, January 18th, 2007

This post is password protected. To view it please enter your password below:


Protected: Trial license in Galaxy

Thursday, January 18th, 2007

This post is password protected. To view it please enter your password below:


Communicating to Flash movie from browser’s JavaScript.

Tuesday, January 2nd, 2007

As you can see on my web site, the menu implemented there using a Flash movie.
When I decided to provide a link from one page of the web site to another, the question was how to change the active site section in a flash movie. I search Internet and found several solutions how to communicate with the Flash movie, but for some reason it was not working for me.
All HTML pages, flash movies and images where located in the same directory on my local computer. I was always getting -1 as a result code for TCurrentFrame or error message in FireFox’s error console Error: Error calling method on NPObject!. Any attempt to revive this interface was failing and there is no clue left on Internet on how to deal with that. (more…)