Issue with Defining Events

I defined this event:

 

 

 

[

ExtenderControlEvent, ClientPropertyName("mouseOver")]
public string OnClientMouseOver
{
 
get { return (string)(ViewState["OnClientMouseOver"] ?? string.Empty); }
 
set { ViewState["OnClientMouseOver"] = value; }
}

in my AJAX component that uses the AJAX Control Toolkit way of developing controls and extenders.  AJAX Control toolkit uses attributes to describe the client component.  The above property is describing an event handler for the mouseOver event of the underlying HTML element; however, what is happening is that this definition was throwing me an error.

Turns out it is because I use the bolded text above in my null coalesce (??) definition; string.Empty doesn't work well in this case.  I switched to null, and it works fine.

Published Saturday, July 12, 2008 3:36 PM by bmains
Filed under:

Comments

No Comments