Solved

New page controls added are not visible in code-behind form some reason...

Posted on 2010-11-13
7
589 Views
Last Modified: 2012-08-13
For some reason, all of a sudden any control I add to the HTML side with the "SERVER" identification doesn't show up in the code behind... I am not sure what happened since the controls that exist already show up just fine but anything new i add does not... I.E. i add a variable like:
<asp:DropDownList runat="server" id="ddlNewElement">
but on the c# side, ddlNewElement is not a valid element?
0
Comment
Question by:dxproz232
7 Comments
 
LVL 5

Expert Comment

by:roxviper
ID: 34127477
do you have a web project or a website?
0
 
LVL 6

Expert Comment

by:AlfredRobot
ID: 34127483
I have this question before, very strange. Basically, that time i delete all the "unidentified control" from aspx page, and restart the vs2010. Then I drag the controls I want to add from toolbox to the aspx page, then it suddenly works. I don't know the reason, hope this will help.
Good luck.
0
 
LVL 16

Expert Comment

by:BurnieP
ID: 34127564
Make sure that you didn't break your HTML tags.  A malformed HTML tag can be the reason VS is not able to recognize any new controls you add.   I had your problem several times and each time it was because I had an <asp: ...  without the end </asp:...

I would check that first.

0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 12

Accepted Solution

by:
jagssidurala earned 500 total points
ID: 34128301
I think you are using VS 2008. if we used this make sure that the control should also present in .designer.cs file. if do not find this in designer.cs we get the error which you mentioned.

to avoid this problem
Cut the control in .aspx and save the file then paste the same. it should work as per my knowlegde.........
0
 

Author Closing Comment

by:dxproz232
ID: 34129388
Thanks everyone but nothing worked until I went into the code-behind and manually added the entry into the designer.cs file. I don't drag elements (I write the HTML manually) so that maybe why it happens to me more then usual? Anyway thanks for the solution...
0
 
LVL 16

Expert Comment

by:BurnieP
ID: 34129422
You should never have to directly modify the designer.cs file.

I am curious to see your .aspx file.  I might be able to find what tag is missing.

Now, you are putting yourself into a corner because you will have to modify the designer.cs file for every control you add in your page.  Normally, everytime you save your page it is silently modifying your designer.cs file with control it sees on it.  Your problem is it doesn't save your controls in the designer.cs file because it is not recognizing your new controls, because of a malformed tag.

I am even curious to see, if you save back your .aspx file if it will remove your modification to the designer.cs file.

That is not the way to go, sorry.  I don't want people google-ing and find that solution as a valuable solution, because it is not.
0
 

Author Comment

by:dxproz232
ID: 34130553
Well the funny thing is once i added the missing entry in the designer.cs file, anything i added after that worked properly...
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

707 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now