开发者

Asmx dynamic compilation

开发者 https://www.devze.com 2023-01-19 19:31 出处:网络
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.

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 possib开发者_如何学JAVAle 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..


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消