Jump to content


ASP.NET C# Code-Behind Model Need Help

  • Please log in to reply
2 replies to this topic

#1 makavelimx


    Young Padawan

  • Members
  • Pip
  • 69 posts
  • Interests:Events Manager of MD5Encryption.com

Posted 17 June 2006 - 01:49 PM

using System.Web.Services;
using System.Net;
[WebServices(Namespace="http://www.bostontechnical.com/webservices/", Description="<b>A web service which performs Domain Name Lookups.</b>")]
publicclass DNSLookupService : System.Web.Services.WebServices
publicstring getIPforHostname(string strHostname)
IPHostEntry hostInfo = Dns.GetHostByName(strHostname);
return hostInfo.AddressList[0].ToString();

In CMD, I do csc DNSLookupService.asmx.cs but I get
Error CS0234: The type or namespae name 'WebServices' does not exist in the namespace 'System.Web.Services' (are you jmissing an assembly referenc)? 
Error CS0246: The type or namespace 'WebServices' coudl not be found (are yu missing a using directive or assembly reference?

Also AFTER I compile it (once the Above problem is addddressed), is

<%@ WebService Language="C#"Class="DNSLookupService" Codebehind="DNSLookupService.asmx.cs"%>

how U write the attribute stuff in DNSLookupService.asmx?

#2 l3lueMage


    Wanna Be Moderator

  • Publishing Betazoids
  • PipPipPipPip
  • 4,602 posts
  • Gender:Male
  • Location:Singapore

Posted 30 June 2006 - 01:27 PM

I dont think anyone here knows C# or ASP, Im starting to learn C# but the windows application version of it :lol:

#3 Mr. Matt

Mr. Matt


  • Validating
  • PipPipPipPip
  • 1,945 posts
  • Gender:Not Telling

Posted 01 July 2006 - 10:22 PM

I can give my mate an ask later on, everyone else is asleep and I currently can't sleep. He does vB.Net and tht is basicaly ASP.net so he might know.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users