Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 61
  • Last Modified:

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.
0
Deepan kumar
Asked:
Deepan kumar
  • 2
1 Solution
 
AndyAinscowCommented:
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
 
AndyAinscowCommented:
Wrong cast was tried
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now