We have Asp.net .aspx and MVC Co-existing project, Codebehind/Codefile are still existing inside .aspx files after project published, it needes a lot of effort to get rid of these after deployment:
we have to manually change every .aspx file
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/xxx.master"
AutoEventWireup="true" Inherits="xxx.Login" Codebehind="Default.aspx.cs" %>
To
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/xxx.master"
AutoEventWireup="true" Inherits="xxx.Login" %>
it is ton of work to do that
anyone can help?
Thanks
Best Answer
You don't need to remove the Codebehind attribute from your ASPX files. You just deploy them without .CS files. The classes specified in the Codebehind are compiled in to the assembly and are available after the assembly gets deployed (which you do always).