Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie Question

Status
Not open for further replies.

Stevoie

Programmer
Jun 7, 2001
68
IE
(in the Client file)
Code:
<%@ Import Namespace=&quot;MathService&quot; %>
this isn't working, i'm getting the following error
Compiler Error Message: CS0118: 'MathService' denotes a 'namespace' where a 'class' was expected

all the files are in a MathService folder, no sub folders.
do i need to setup the namespace so that the asp.net knows where it is before the client can access its methods.
should i use relative or absolute addresss for the namespace? the tutorials i've found aren't every helpful when something goes wrong. StevoIE
 
imports System.Math is what you need. Also this is usually done on your code behind page. Unless of couse you are using old school spagetti code then you don't have any choice but to include it on the html page.

HTH That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
the MathService is a .asmx server page, it allows me access to basic math operations, got it from a tutorial page. Nothing to do with System.Math. Its just that the client file can't see it when it is complied by the web server.
ideas?

got it from this site:
StevoIE
 
Oh... Well I am not sure that you can import a page into another page anymore. You could make a variable of that class type and call up the functions you need, I suppose but a better way would be to put the functions into an actuall class (rather than a code behind class) and use them in whichever pages are needed. That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
your right, i forgot to mention that the server page .aspx is compiled into a .cs file using the wsdl command. so the client file is trying to access a class file - MathService.cs, which is located in the same directory as the MathServiceClient.aspx (client file) but the client file just can't see the .cs file StevoIE
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top