Ok, so we know this feature will become horribly abused and nobody’s going to know where the hell methods are defined. But, come on, you know you love this:
DropDownList cboProfiles;
int selectedValue= this.cboProfiles.SelectedValue.ToInt();
OR
int selectedValue= this.ViewState[“MyKey”].ToInt() ; Courtesy of these trivial extension methods: public static class TypeHelper
{
public static int ToInt(this string value)
{
return Convert.ToInt32(value);
}
public static int ToInt(this object value)
{
return Convert.ToInt32(value);
}
}
Admit it, your looking for a way for your next hit!J