Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2016-10-10
2
Medium Priority
?
59 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 45

Accepted Solution

by:
AndyAinscow earned 2000 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 45

Expert Comment

by:AndyAinscow
ID: 41865062
Wrong cast was tried
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

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…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Integration Management Part 2
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

971 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