Technical

Add static item to DropDownList web control after data bind in ASP.NET

Sometimes we need to add a static item to the top of DropDownList web control, such as "-- Please select --" or any other text. This static item will be removed and replaced with the items that comes from the data source you are using after calling DataBind() method.  To keep the static item you are...

String functions StartsWith and EndsWith are case-sensitive in .NET

Did you know that String functions StartsWith and EndsWith are case-sensitive even in VB.NET? You will need to make sure you are looking for the correct string, since 'abc' with case-sensitivity is different than 'ABC'. So, if your function is looking for 'abc', you must make sure that you make adjustments to the string, in...

Disable configuration inheritance in ASP.NET

Configuration inheritance is a very good feature of ASP.NET. It allows you to set configuration settings in the Web.config file of a parent application and have it automatically be applied to all of its child applications. But sometimes you do not want the child applications to inherit the configuration from its parent application, so you...

Get XPath of an XML node

There are lots of XSL templates out there that get a human readable path to a node. But none of them cover the case when there are more than one node of the same element at the same level. Please find below the code that get XPath of an XML node: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output...

Password recovery web control

Password recovery web control can not send email via SSL mail servers in ASP.NET

We were using lately the login controls for ASP.NET in a website we are working on it. We discovered a bug or we can call it limitation in the password recovery web control. We used to use the membership provider and login controls, but we did not face this problem before since we were...