For specific situation of handling the drillthrough you can do the following:
1. Define 2 strings that will store the event actions such as this:
private string strAction;
private string strActionPara;
2. Then wire the Snowflake.net control's BeforeUIAction event with following code:
private void BeforeUIAction(object sender, SnowflakeNS.Snowflake.BeforeUIActionEventArgs e)
{
strAction = e.Action;
strActionPara = e.ActionPara;
}
Note that the BeforeUIAction event occurs prior to interpreting the UI action including the Drillthrough so the actions will be caught prior to the error occurring.
3. Now modify your Page_Error to look like this:
private void Page_Error(object sender, EventArgs e)
{
string errorMessage = "Error Occured:";
if (strAction=="DrillThrough")
{
errorMessage += "The selected field does not support drillthrough.";
}
errorMessage += "\r\n";
errorMessage += Server.GetLastError();
Server.ClearError();
Response.Write( errorMessage );
}
While the Action gives us the idea that this is the drillthrough the ActionPara is not of much use in this case as it is simply the cell number so it is not used in the message.
See Also Handle the exceptions that occur within Snowflake.net
|
|
Copyright © 2004 Intellimerce Inc. All rights reserved.