Coding mistakes

Wednesday, June 01, 2005

Code behind

Server Error in '/ASPNET_Test2' Application.
--------------------------------------------------------------------------------

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS1595: 'Util.TempUtil2' is defined in multiple places; using definition from 'c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\aspnet_test2\491bfbd0\d1884c7\assembly\dl2\642f7e40\6e03d7f9_da66c501\ASPNET_Test2.DLL'

Reason: I was doing code behind:
<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="Util.TempUtil"
Src="Util.cs" %>

Fix: Set the Build Action for util.csfrom Compile to None.

Tip: The Codebehind attribute is only used by VS.NET, but by ASP.NET.

0 Comments:

Post a Comment

<< Home