views:

2208

answers:

2

Hi, 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 dont understand what is going on here

A: 

If you created the new 3.5 app as a Web Site instead of a Web Application, that could be causing what you see.

Take a look at this old blog post that explains some of the differences here: Web Site vs. Web Application

I don't think I fully answered your question, but hopefully these breadcrumbs will lead you down the right path.

CubanX
A: 

To add to what CubanX said, even if you did create it as a Web Application (rather than a Web Site), it can still be worth right-clicking your Web Application Project in Visual Studio's Solution Explorer and clicking "Convert To Web Application", even though it already is one.

We found this fixed a few mysterious problems for us - we never figured out why though. :)

teedyay