I have been able to create ASPX pages without the code behind, but I can't for the life of me figure out the magic combination to get an ASMX page to work without a code behind. Is this even possible?
Quick sample:
<%@ WebService Language="C#" Class="SampleWebService" %>
using System;
using System.Data;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class SampleWebService : System.Web.Services.WebService
{
[WebMethod]
public string Hello()
{
return "Hello World!";
}
[WebMethod]
public string DoStuff(out string stuff)
{
stuff = "Woohoo!";
return "OK";
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With