Solved

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

Posted on 2016-10-10
2
21 Views
Last Modified: 2016-10-29
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
Comment
Question by:Deepan kumar
  • 2
2 Comments
 
LVL 44

Accepted Solution

by:
AndyAinscow earned 500 total points (awarded by participants)
ID: 41837047
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
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 41865062
Wrong cast was tried
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question