Unable to cast object of type 'System.Web.UI.LiteralControl' to type 'System.Windows.Forms.Control'

hi,

i am trying to getting my all controls from the asp.net page, while i am reading the controls it will thrown an  error like as the tittle.
plz any  one can resolve it.
Deepan kumarAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
AndyAinscowConnect With a Mentor Freelance programmer / ConsultantCommented:
You are trying to cast chalk to cheese - no relationship.  
You need to use the System.Web.UI based controls not the System.Windows.Forms based controls as you try to do at present.
0
 
AndyAinscowFreelance programmer / ConsultantCommented:
Wrong cast was tried
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.