How to check the type of an object or control using VB.NET or C#

The VB.NET check up is:

If (TypeOf sender Is TextBox)Then
Dim txt As TextBox= DirectCast(sender, TextBox)
End If



And the C# code:

if (sender Is TextBox){
TextBox txt=(TextBox)sender;
}

Error reporting in PHP run on IIS

The PHP error reporting is controlled either by the php.ini file as a global setting or programatically, or using .htaccess.

The error reporting in php.ini is defined in "Error handling and logging" section.
  • error_reporting = E_ALL & ~E_NOTICE - shows all errors except E_NOTICE errors. E_NOTICE are possible errors which can occur even during normal program workflow - something like Microsoft's warnings.
  • display_errors = On
  • display_startup_errors = On
Programmatically the same settings are applied for current site like this:
ini_set('display_errors','1');
ini_set('display_startup_errors','1');
error_reporting(E_ALL & ~E_NOTICE);

In .htaccess the flags must be changed in the following way:
php_flag display_errors 1
php_flag display_startup_errors 1


Php error_reproting help -> http://php.net/error_reporting

URL Encoding - reserved and unsafe characters

RFC 1738: Uniform Resource Locators (URL) specification is described in the following page. Also simple convertor is included.

http://www.blooberry.com/indexdot/html/topics/urlencoding.htm


Server.URLEncode(url)
applies these rules to the url. During getting an url parameter from the query string the value will be automatically decoded.

Javascript trace log

Simple and useful tool can be found here:

http://v2.easy-designs.net/code/jsTrace/


Using it you can get rid of the alert messages while debug applications.

How to excute string with javascript

Simply use eval().

eval('peformAction()') will execute