Category Archives: 3rd party

3rd party software for ASP.NET

PHPBB: Update template file by purging cache

Scenario: You’re trying to update a template file in your PHPBB 3.0.x forum, for example to include Google Adsense code into overall_header.html file to display banner on top of all the pages. But after modifying and uploading the file nothing changes, board still displays old template.

What is happening – PHPBB displays cached version of the template. Forum software caches commonly used files to improve performance. The solution is to purge cache.
Purgin Cache in PHPBB 3.0.x board
Login to your forum Administration Control Panel and click Run Now in Purge the cache section. After purging is complete changes in your template take effect.

Injecting client script into Infragistics async postback

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 →

Infragistics WebDataMenu: Expanding context menu UP

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 Drag and Drop: detecting element during drag

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 →

Global Chart Type for Dundas Chart Control

      Dundas Charts for .NET has many cool features like async callbacks, AJAX scroll and zoom, plenty of chart types and great visuals, but in some cases some of those features could turn out to be more of a burden than useful. One example – the ability to set chart type for each individual series of a chart. This offers great flexibility in building combination charts (you can display column and line on the same chart to reflect different series’ data), but you’re losing the Infragistics simplicity of just setting the chart type and binding chart to data without worrying about appearance of each individual series.
      This is especially inconvinient if you load chart appearance (including series appearance and chart type) from an external template. If you want to use chart type from the template, but feed it your own data – you’re stuck.  But there is a solution. Continue reading →