简体   繁体   中英

Web Deployment

We had an asp.net 1.1 application that we recently migrated to 3.5. We are facing some problems when we do code modification on the migrated application. Here is what is happening

  1. In the asp.net 1.1 application we have the page directive codebehind="ePC.aspx.cs". This migrated fine.
  2. We made some code changes to the .cs file. Say for example, we added a button and added the event handler to the button.
  3. This new functionality was not getting executed properly.
  4. We changed the codebehind directive to codefile directive
  5. Now it is working fine. But during deployment, it asks that the .cs file also be deployed along with the aspx page. We are not sure why this is happening.

I have attached an example page directive

In VisualStudio with CodeFile

<%@ Page language="c#" Codefile="ePC.aspx.cs" AutoEventWireup="True"   Inherits="SPUniversal.Web.ePC" %>

After publishing the website

<%@ page language="c#" autoeventwireup="True" inherits="SPUniversal.Web.ePC, App_Web_eu_mdesx" %>

The App_Web_eu_mdesx got generated automatically in the published website. I don't understand what is going on here. Can you explain?

For 2.0 sites, you have several options of how ASP.Net handles your web site. You can use default compilation, or pre-compiled sites. If you use default compilation, you need to have the source files on the server because inn this mode, ASP.Net will re-compile the website dynamically if it detects any changes to any of the source .cs or .aspx files.

You may want to look into the pre-compilation options available . By pre-compiling your site when you deploy it, you won't necessarily have to put the .cs files on the server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM