<p>Ok, so, my visual studio is broken. I say this NOT prematurely, as it was my first response to see where I had messed up in my code. When I add controls to the page I can't reference all of them in the code behind. Some of them I can, it seems that the first few I put on a page work, then it just stops. </p>

<p>I first thought it may be the type of control as initially I was trying to reference a repeater inside an update panel. I know I am correctly referencing the code behind in my aspx page. But just in case it was a  screw up on my part I started to recreate the page from scratch and this time got a few more controls down before VS stopped recognizing my controls.</p>

<p>After creating my page twice and getting stuck I thought maybe it was still the type of controls. I created a new page and just threw some labels on it. No dice, build fails when referencing the control from the code behind. </p>

<p>In a possibly unrelated note when I switch to the dreaded "design" mode of the aspx pages VS 2008 errors out and restarts. </p>

<p>I have already put a trouble ticket in to Microsoft. I uninstalled all add-ins, I reinstalled visual studio. </p>

<p>Anyone that wants to see my code just ask, but I am using the straight WYSIWYG visual studio "new aspx page" nothing fancy.</p>

<p>I doubt anyone has run into this, but have you? </p>

<p>Has anyone had success trouble shooting these things with Microsoft? Any way to expedite this ticket without paying??? I have been talking to a rep from Microsoft for days with no luck yet and I am dead in the water. </p>

<hr>

<p><strong>Jon Limjap:</strong> I edited the title to both make it clear and descriptive <em>and</em> make sure that nobody sees it as offensive. "Foo-barred" doesn't exactly constitute a proper question title, although your question is clearly a valid one.</p>

[{'answer_id': 38688, 'author': 'Sean Lynch', 'author_id': 4043, 'author_profile': 'https://Stackoverflow.com/users/4043', 'pm_score': 4, 'selected': False, 'text': '<p>Is the control that you are trying to reference inside of the repeater?</p>\n\n<p>If so then you need to look them up using the FindControl method.</p>\n\n<p>For example for:</p>\n\n<pre><code>&lt;asp:Repeater ID="Repeater1" runat="server"&gt;\n    &lt;ItemTemplate&gt;\n        &lt;asp:LinkButton ID="LinkButton1" runat="server"&gt;stest&lt;/asp:LinkButton&gt;\n    &lt;/ItemTemplate&gt;\n&lt;/asp:Repeater&gt;\n</code></pre>\n\n<p>You would need to do this to reference it:</p>\n\n<pre><code>LinkButton lb = Repeater1.FindControl("LinkButton1");\n</code></pre>\n'}, {'answer_id': 38704, 'author': 'Brian Boatright', 'author_id': 3747, 'author_profile': 'https://Stackoverflow.com/users/3747', 'pm_score': 5, 'selected': True, 'text': "<p>try clearing your local VS cache. find your project and delete the folder. the folder is created by VS for what reason I honestly don't understand. but I've had several occasions where clearing it and doing a re-build fixes things... hope this is all that you need as well.</p>\n\n<p>here</p>\n\n<pre><code>%Temp%\\VWDWebCache\n</code></pre>\n\n<p>and possibly here</p>\n\n<pre><code>%LocalAppData%\\Microsoft\\WebsiteCache\n</code></pre>\n"}, {'answer_id': 735840, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 2, 'selected': False, 'text': '<p>you will also find .net temp files which are safe to delete here:\nC:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\Temporary ASP.NET Files</p>\n'}, {'answer_id': 2140905, 'author': 'LorettoDave', 'author_id': 160819, 'author_profile': 'https://Stackoverflow.com/users/160819', 'pm_score': 5, 'selected': False, 'text': '<p>The above fix (deleting the temp files) did not work for me.  I had to delete the <code>PageName.aspx.designer.cs</code> file, then right-click my page, and choose "Convert to Web Application" from the context menu.  </p>\n\n<p>When Visual Studio attempted to rebuild the designer file, it encountered (and revealed to me) the source of the problem.  In my case, VS had lost a reference to a DLL needed by one of the controls on my page, so I had to clean out the generated bin folders in my project.</p>\n'}, {'answer_id': 3021053, 'author': 'Daan', 'author_id': 7922, 'author_profile': 'https://Stackoverflow.com/users/7922', 'pm_score': 3, 'selected': False, 'text': '<p>In my case, I was working with some old web site code, which I converted to a VS2008 solution. I encountered this same problem.</p>\n\n<p>For me, the fix was to right-click the Web Sites project in the Solution Explorer and select Convert to Web Application. This created <code>designer.cs</code> files for all pages, which did not yet have these files before. </p>\n'}, {'answer_id': 5374093, 'author': 'Leah', 'author_id': 5506, 'author_profile': 'https://Stackoverflow.com/users/5506', 'pm_score': 2, 'selected': False, 'text': '<p>In my case new asp controls I added to an existing were not being detected. </p>\n\n<p>What worked for me was forcing a recompile by renaming an existing control to break the build eg: changing <code>&lt;asp:TextBox ID="txtTitle" runat="server" /&gt;</code> to <code>&lt;asp:TextBox ID="txtTitle2" runat="server" /&gt;</code> </p>\n\n<p>When I corrected the ID and rebuilt a new designer file was generated with the corrected ID and new controls. </p>\n'}, {'answer_id': 6883044, 'author': 'Dennis', 'author_id': 870634, 'author_profile': 'https://Stackoverflow.com/users/870634', 'pm_score': 0, 'selected': False, 'text': '<p>For me, deleting/renaming the files in the following location worked:</p>\n\n<pre><code>C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\Temporary ASP.NET Files\\myvirtualwebsite\\e331e0a9 \n</code></pre>\n'}, {'answer_id': 9791810, 'author': 'Yogesh P', 'author_id': 1281569, 'author_profile': 'https://Stackoverflow.com/users/1281569', 'pm_score': 2, 'selected': False, 'text': '<p>I observed this happens because of missing .designer.cs file. Following fixed this issue in my case (basically I had these files copied from VS 2005 web project to VS 2010 project): Right Click on .aspx file and select menu "Convert to Web site", this will create .designer.cs file and then it should work file. </p>\n'}, {'answer_id': 11666306, 'author': 'Sardor', 'author_id': 1554125, 'author_profile': 'https://Stackoverflow.com/users/1554125', 'pm_score': 0, 'selected': False, 'text': "<p>Check out your aspx file on errors, once I've faced with that problem</p>\n"}, {'answer_id': 12899948, 'author': 'StronglyTyped', 'author_id': 650183, 'author_profile': 'https://Stackoverflow.com/users/650183', 'pm_score': 0, 'selected': False, 'text': '<p>I had this happen a few times and it happened again today for a new reason. I normally run my project through IIS but needed to run it locally to debug. I normally run on port 80 in IIS and 81 in debug, but I had some settings in the web.config that used 80 so I just killed the site in IIS and switched the website to port 80 in the project settings. For whatever reason, this messed everything up and created the problem described in the OP. I started trying things one by one, including all the advice mentioned here, but switching the port back to 81 in the project settings is what ended up working.</p>\n'}, {'answer_id': 14338758, 'author': 'Reinaldo', 'author_id': 1980420, 'author_profile': 'https://Stackoverflow.com/users/1980420', 'pm_score': 1, 'selected': False, 'text': '<p>right click on project name and select "Clean". then, check your bin folder if it has any dll remaining. if so, delete it. that´s it. just rebuild and every thing will work fine.</p>\n'}, {'answer_id': 15510165, 'author': 'Riccarr', 'author_id': 1935103, 'author_profile': 'https://Stackoverflow.com/users/1935103', 'pm_score': 0, 'selected': False, 'text': '<p>Just to add my two cents with this problem.</p>\n\n<p>The only thing from all the above that worked for me was the "Clean" and then delete anything left in the bin folder. Rebuild and all controls started working then.</p>\n'}, {'answer_id': 16919982, 'author': 'George H', 'author_id': 952916, 'author_profile': 'https://Stackoverflow.com/users/952916', 'pm_score': 0, 'selected': False, 'text': '<p>FYI...I was having this problem too and I ended up fixing it by deleting the existing .designer.vb file, right-clicking on the project and choosing Convert to Web Application. It then showed the real "error" that was causing the GUI to crap itself. Turned out I had used the same name for 2 other labels but that wasn\'t being shown in the error list window. Once I renamed one of the 2 other labels it built fine and stopped giving me trouble.</p>\n'}, {'answer_id': 34755346, 'author': 'Tony L.', 'author_id': 3347858, 'author_profile': 'https://Stackoverflow.com/users/3347858', 'pm_score': 1, 'selected': False, 'text': '<p>This can also happen if the <code>Inherits</code> property on the source page doesn\'t match the class name in the code behind. Generally speaking, this would probably only happen if you copy/pasted a .ascx/.aspx file and forgot to update it.</p>\n\n<p>Example:</p>\n\n<pre><code>&lt;%@ Control AutoEventWireup="false" CodeBehind="myControl.ascx.vb" Inherits="myProject.myWrongControl" %&gt;\n</code></pre>\n\n<p>The the code behind class:</p>\n\n<pre><code>Partial Public Class myControl\n</code></pre>\n'}, {'answer_id': 39342380, 'author': 'Alberto Belfanti', 'author_id': 5889239, 'author_profile': 'https://Stackoverflow.com/users/5889239', 'pm_score': 0, 'selected': False, 'text': '<p>You have to add</p>\n\n<pre><code>runat="server"\n</code></pre>\n\n<p>to each element in your page.</p>\n'}, {'answer_id': 44381474, 'author': 'sharath kumar', 'author_id': 8117488, 'author_profile': 'https://Stackoverflow.com/users/8117488', 'pm_score': 1, 'selected': False, 'text': '<p>we cannot change the code when the application is running .To do so first click  on the stop button on the top which will halt your application .now click on the button in design mode ,it will insert the code in .aspx.cs file ,then write the code in it</p>\n'}]
['https://Stackoverflow.com/questions/38670', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4140/']