Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Not Connecting Designer to Code Behind

I started using VisualStudio 2013 last week, and have loved it. But I was primarily coding controllers and JavaScript. However, when I add a control to a Webform inside of a Web Project, it doesn't generate the code inside the .designer.cs file.

I can open the file up and add it manually, which is fine for now; but, will get very frustrating in the future.

For reference, I'm also using Resharper 8, and ASP.NET 4.5.

Has anybody else had this issue or found a work around in the past with another version of Visual Studio?

like image 390
jamesbar2 Avatar asked Jan 20 '26 01:01

jamesbar2


1 Answers

It happens sometimes when ASPX and designer are out of sync.

Sometime just saving the ASPX file Ctrl+S solves the problem.

The worst case you can delete the individual xxx.designer.cs, and recreate it by using Convert to Web Application

Visual Studio 2012

enter image description here

Updated for Visual Studio 2013

In VS 2013, Convert to Web Application is moved under Project.

enter image description here

like image 63
Win Avatar answered Jan 22 '26 15:01

Win



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!