• Home
  • About
  • Resume

Google investigation

By , 07/31/2009 3:59 PM

We were updating our family blog with some older photos from our previous travels when we found this picture

The problem was – we didn’t remember neither the name of this place nor the date (only that it was somewhere in Brooklyn sometime in 2006). So our quest began.
Continue reading 'Google investigation'»

Backup early, backup often

By , 07/28/2009 11:15 AM

Had a fire in the building today

It is good to be prepared.

Injecting client script into Infragistics async postback

By , 07/28/2009 10:16 AM

Often there is a need to add client-side Javascript to the ASP.NET page from server-side code. To perform additional manipulation on rendered controls (hide or disable), to show user an alert message – just a couple of examples. Standard ASP.NET approach is to use page’s client script manager’s  RegisterStartupScript method:

Me.ClientScript.RegisterStartupScript (Type,  Key,  Script, AddScriptTags)

Where

type: The type of the startup script to register.
key: The key of the startup script to register.
script: The startup script literal to register.
addScriptTags: A Boolean value indicating whether to add script tags.

For example:

Me.ClientScript.RegisterStartupScript (Me.GetType(), "alert", "alert('Hello world!');", True)

But if you’re using Infragistics controls that offer async postbacks, like WARP panel or UltraWebTab – there is a problem with this approach.  Since the page doesn’t go through the full postback and doesn’t get destroyed and re-rendered from scratch – this method doesn’t work. Continue reading 'Injecting client script into Infragistics async postback'»

Infragistics WebDataMenu: Expanding context menu UP

By , 07/21/2009 4:08 PM

Infragistics WebDataMenu is a light-weight highly responsive menu control with rich server and clinet side model. I was using it to display context menu on right mouse click.  The code is pretty simple:

function onMouseClick(oEvent) {
   if (oEvent.button == 2) { //right mouse button clicked
      var menu = $find("xwdmMyMenu");
      menu.showAt(null,null, oEvent);
   }
}

It checks whether the right mouse button was clicked (line 2) then locates the menu object and shows it using showAt method (which accepts 3 parameters, either X and Y client coordinates, or event object from which it derives coordinates of the mouse click).

 It’s all well and good, but the problem is – menu always shows down from the location of the mouse click. And if the click is at the bottom of the screen – menu gets cut off:

I needed to make menu expand UP and  couldn’t find a build-in property or method that would change this behaviour (GroupSettings.ExpandDirection property had no effect). Time for a little hack. Continue reading 'Infragistics WebDataMenu: Expanding context menu UP'»

Take a friv break

By , 07/14/2009 8:57 PM

Tired of all that coding? Take a well deserved break with this fine site, filled with 250+ Flash games combined into unusual one-screen interface:
Friv
So go ahead, visit http://www.friv.co.uk, but heed this warning: many of the games require non-trivial thinking (not to mention they’re highgly addictive).

Infragistics Drag and Drop: detecting element during drag

By , 07/13/2009 4:18 PM

I was using Infragistics drag-and-drop framework and set an HTML table element as my drop target. Now I needed to know during drag operation over which HTML table cell I am moving. I needed that in order to dynamically change appearance of draggable markup depending on which cell I am currently over.



(Think a strategy game – you’re placing construction on the terrain – if there is enough unoccupied room – the draggable item becomes green, otherwise it remains red).

The solution is to use elemAtPoint property during DragMoveHandler event. Continue reading 'Infragistics Drag and Drop: detecting element during drag'»

WebDialogWindow – removing IFRAME border in IE

By , 07/10/2009 2:49 PM

Infragistics WebDialogWindow control is a flexible and lightweight AJAX dialog control designed to look and feel like standard Windows dialogs. One of its neat features – it allows to load the content from an external URL. In that case it renders the content inside of an IFRAME, which is all good and well, but leaves an ugly default iframe border.

Browsers like FireFox can remediate this by simple setting the “frameborder” attribute of the content pane IFRAME element:

function showDialog() {      
    var oDialog = $find('xwdwMyDialog')
    var oDialogContent = oDialog.get_contentPane();
    var oDialogIFrame = oDialogContent.get_iframe();

    // Removing IFRAME border in FireFox
    oDialogIFrame.setAttribute('frameborder', '0');

    oDialog.show();
}

but unfortunatelly this doesn’t work in IE. Continue reading 'WebDialogWindow – removing IFRAME border in IE'»

Setting DOM element height and width thru style in IE and Firefox

By , 07/09/2009 12:44 PM

I was using a pretty standard line of JavaScript code to set dimentions of an HTML element, something like:

oDiv.style.height = iWindowHeight/2 - 50;

It was working fine in IE, but had no effect whatsoever in Firefox.
Turned out all that was needed – to add ‘px’ to that line:

oDiv.style.height = iWindowHeight/2 - 50 + 'px';

and it works fine in both browsers.

It’s official: Google is taking over the world

By , 07/08/2009 3:40 PM

Google OS rumored so much over the last year or so finally is becoming a reality. And it’s going to be open-source, based on Chrome browser and Linux kernel, no less. Browser based OS, completely dependant on the Internet and with all the data stored in Google cloud.. I think I am sticking with my Windows 7 for now.

Correcting “ASP.NET AJAX client-side framework failed to load” error

By , 07/08/2009 11:40 AM

If you’re trying to use ASP.NET AJAX features (like Script Manager or Update Panel) in your ASP.NET 3.x website and getting “ASP.NET AJAX client-side framework failed to load” error, chances are your Web.config file is missing required sections. Fastest way to correct this is to create a new ASP.NET website in Visual Studio (you can delete it afterwards) and copy missing sections from the new web.config to the one in your web site.

Update: As churawut pointed out missing .AXD mapping in IIS configuration is another common source of this error (often this is done as security hardening on the IIS).  I encountered it while researching missing images in ASP.NET charts, and found out that underlying reason was missing/corrupt .AXD mapping in IIS.

Panorama Theme by Themocracy