views:

25

answers:

1

If I want to compile the source (cs) file of the web page, i simply use Src attribute instead of CodeBehind attribute in the Page directive, e.g.

<%@ Page Language="C#" AutoEventWireup="true" Src="XXX.aspx.cs" Inherits="Namespace.Path.To.XXX" %>

which works perfectly with a source file that has the BuildAction set to Content. Is it possible to do the similar thing for an asmx web service ? The WebService directive doesn't support the Src attribute and when I use CodeBehind it simply can't find the class..

A: 

I've figured out it's enough to simply leave out the CodeBehind attribute and put the source directly in the asmx file - it is then compiled dynamically.

Thomas Wanner