Dynamically call a xslt template

You cannot call a xslt template like: <xsl:variable name="templateName" select="test"></xsl:variable> <xsl:call-template name="$templateName"> <xsl:template name="test"> </xsl:template> The clossed you can get to calling a xslt template dynamically is to use the <xsl:if or <xsl:choose based on a variable: <xsl:if test="$parameter1=$templateName"> <xsl:call-template name="test"></xsl:if>

Generic C# function for reading a value from registry

Nice generic read value from registry function on: http://www.codeproject.com/KB/dotnet/frameworkversiondetection.aspx Function can be called like: using System; using Microsoft.Win32; using NUnit.Framework; using Ada.Cdf.Common; namespace Ada.Cdf.Test.Common { [TestFixture] public class RegistryHelperTester { [Test] public void GetRegistryValueTest() { string data = string.Empty; // Read a registry key value bool result = RegistryHelper.GetRegistryValue<string>(RegistryHive.LocalMachine,@"SOFTWARE\Microsoft\Windows\CurrentVersion","ProgramFilesDir", RegistryValueKind.String, …

IE 6 and Telerik error: Sys.InvalidOperationException Telerik.Web.UI.Orientation has already been registered

If you get the error: Microsoft JScript runtime error: Sys.InvalidOperationException: Type Telerik.Web.UI.Orientation has already been registered. The type may be defined multiple times or the script file that defines it may have already been loaded. A possible cause is a change of settings during a partial update. in IE 6, …

.NET service (.svc) and “The page you are requesting cannot be served because of the extension configuration”

When you want to debug a .net service (*.svc) and you get the error: “The page you are requesting cannot be served because of the extension configuration”. Try the solution on: http://tonytriguero.com/iis-7-and-webservices-svc-file-extension/ Open Visual Studio 2008 Command prompt. Navigate to C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation Run this command: servicemodelreg –i

Set initial sorting on a Telerik RadGrid column

If you want to set an initial sorting on a column on a Telerik RadGrid, use the “NeedDataSource” event and add a GridSortExpression to the MasterTableView.SortExpressions protected void RadGrid_NeedDataSource(object source, GridNeedDataSourceEventArgs e) { // Set datasource here… if (!IsPostBack) { // Clear the current sortexpressions this.RadGrid.MasterTableView.SortExpressions.Clear(); // Create "Date" sorting …

Set initial filter on GridDateTimeColumn in a Telerik RadGrid

If you want to set an initial filter on a Telerik RadGrid, use the “NeedDataSource” event and set the MasterTableView.FilterExpression and use the function MasterTableView.GetColumnSafe protected void RadGrid_NeedDataSource(object source, GridNeedDataSourceEventArgs e) { // Set datasource here… if (!IsPostBack) { // Set initial filter on [RadGrid] this.RadGrid.MasterTableView.FilterExpression = string.Format("([Date] = ‘{0}’)", …

Cannot find column Customer when sorting a Telerik RadGrid column with LLBLGen entities

When you sort a column in a Telerik RadGrid you get the error “Cannot find column Customer”, make sure the  SortExpression is the same as the DataField DataField="Customer.Description" HeaderText="Customer" SortExpression="Customer.Description" UniqueName="Customer" If SortExpression is not the same as the DataFiel, you will get the error: Message: Cannot find column Customer …