2010-05-24

C# Type safe casting and explicit casting

Explicit casting :
Label label = (
Label)e.FooterRow.FindControl("lblNAme");

if (label != null)
{
// Todo :

}

Type safe casting :
Label label = e.FooterRow.FindControl("lblNAme") as Label;
//'is' keyword is used in conjunction after 'as', to provide
//a more intuitive
then comparing to null as in explicit casting sample
if (label is Label)
{
// Todo :
}




2010-04-28

Using custom ObjectDataSource with Gridview



Using ObjectDataSource on existing POCO object with GridView.


And use GridView's footer as the input template.

source :

http://www.highoncoding.com/Articles/139_GridView_With_ObjectDataSource.aspx


Support for Gridview Editing / Deleting

ShareThis