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

x
?
Solved

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

Posted on 2010-11-13
7
Medium Priority
?
633 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 12

Accepted Solution

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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.…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

877 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