G
Guest
Error: Unable to cast object of type 'ASP.CompanyDirectory_aspx' to type
'CompanyDirectory'.
Code:
clsCompanyDirectory = (CompanyDirectory)Context.Handler;
getCompanyProfile(Strings.ConvertToInt(clsCompanyDirectory.CompanyIDValue));
Question: I have other pages with the exact same code and it does not
error. Why would this error? Am I missing something? How can the same page
not be cast on itself if it's the same type? Or maybe I need code that skips
the cast because it's already the page I need? This page is referenced in
the aspx file. Below is the same code except it it used in another area of
the site.
Code used in another page, *but works*:
// Create an instance of the page reference class to get incoming values
clsTranslatorDirectory = (TranslatorDirectory)Context.Handler
getTranslatorProfile(Strings.ConvertToInt(clsTranslatorDirectory.TranslatorIDValue));
Please explain the problem if you understand my issue. Thanks!
'CompanyDirectory'.
Code:
clsCompanyDirectory = (CompanyDirectory)Context.Handler;
getCompanyProfile(Strings.ConvertToInt(clsCompanyDirectory.CompanyIDValue));
Question: I have other pages with the exact same code and it does not
error. Why would this error? Am I missing something? How can the same page
not be cast on itself if it's the same type? Or maybe I need code that skips
the cast because it's already the page I need? This page is referenced in
the aspx file. Below is the same code except it it used in another area of
the site.
Code used in another page, *but works*:
// Create an instance of the page reference class to get incoming values
clsTranslatorDirectory = (TranslatorDirectory)Context.Handler
getTranslatorProfile(Strings.ConvertToInt(clsTranslatorDirectory.TranslatorIDValue));
Please explain the problem if you understand my issue. Thanks!