Question Specifying the name used for the JavaScript class


Well-known member
Mar 16, 2011
Programming Experience
I am creating a WebService using the following:

<%@ WebService Language="vb" CodeBehind="~/MyWebService.asmx.vb" Class="myprojectname.MyWebService" %>

This works fine, except that it names the generated JavaScript class "myprojectname.MyWebService" (which is longer than I would like), but I want it to be named "MyWebService" (or something shorter than the fully qualified class). If I change the Class attribute to Class="MyWebService" I receive an error that the webservice cannot be created (obviously because it needs to know the fully qualified class). Is there any other way to let it know the fully qualified class name (maybe some other extra directive?) or some way to specify what name I want it to use for the JavaScript class? Thanks.
Top Bottom