Hi ,
I am new to asp.net .. I am trying to solve the invalid cast exception but facing some issues with that:
static private void RegisterJavaScriptFooter(string scriptName, StringBuilder scriptBlock)
{
((PgDisplayBase)System.Web.HttpContext.Current.Handler).RegisterClientScriptFooterBlock(scriptName, scriptBlock.Insert(0, SetupJavaScriptHeader()).Append(SetupJavaScriptFooter()).ToString());
}
I am getting the exception on this line :
Unable to cast object of type 'System.Web.DefaultHttpHandler' to type 'Intel.SWFactory.Platform.Common.PgDisplayBase'.
I tried resolving this as:
static private void RegisterJavaScriptFooter(string scriptName, StringBuilder scriptBlock)
{
try
{
((PgDisplayBase)System.Web.HttpContext.Current.Handler).RegisterClientScriptFooterBlock(scriptName, scriptBlock.Insert(0, SetupJavaScriptHeader()).Append(SetupJavaScriptFooter()).ToString());
}
catch (InvalidCastException e)
{
throw(e);
}
}
but nothing works out ..