Solved

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

Posted on 2010-11-13
7
625 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Suggested Courses

751 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