[Microsoft.Web.Script.Services.ScriptService()] - The type or namespace name 'Web' does not exist in the namespace 'Microsoft'

Rate It (1)

Last post 07-02-2009 7:25 AM by JamieKitson. 19 replies.

Sort Posts:

  • Re: [Microsoft.Web.Script.Services.ScriptService()] - The type or namespace name 'Web' does not exist in the namespace 'Microsoft'

    01-14-2008, 11:27 AM
    • Member
      24 point Member
    • kabrown
    • Member since 05-16-2007, 5:20 PM
    • Posts 29

    I'm not sure I understand exactly what you're asking. 

    If you have added a webservice to your project you can test it by using it's URL.  For example  I have a webservice in my project called TestService.asmx.  In order to test it I use this URL:

    http://localhost:65269/OpenDoor/TestService.asmx

    To get the proper port, just run your project in debug which gives me:

    http://localhost:65269/OpenDoor/Default.asp

    then just change the Default.asp to TestService.asmx

    In my ASP file I'm using the webservice in a Cascading drop down (used in the ServicePath):

    <ajaxToolkit:CascadingDropDown ID="cddlEmployee" runat="server"

    Category="Roles" LoadingText="Please wait..."

    ParentControlID="ddlRole" PromptText="Select a Volunteer"

    TargetControlID="ddlEmployee"

    ServicePath="http://localhost:65269/OpenDoor/TestService.asmx" ServiceMethod="GetEmployeesByRole" />

     Hope that was what you were looking for.

  • Re: [Microsoft.Web.Script.Services.ScriptService()] - The type or namespace name 'Web' does not exist in the namespace 'Microsoft'

    01-14-2008, 1:00 PM
    • Member
      18 point Member
    • imei
    • Member since 01-08-2008, 9:57 PM
    • Posts 17

    This is very helpful.

    I see that the line that invokes the webservice is ServicePath="http://......". Is this the only line I need to invoke a webservice?

    How does the parameter pass into the GetEmployeesByRole method (if it takes parameters)?

    Also, Where can I place this code, in ButtonClick, Pageload, or something like that?

    THANKS!

  • Re: [Microsoft.Web.Script.Services.ScriptService()] - The type or namespace name 'Web' does not exist in the namespace 'Microsoft'

    01-16-2008, 10:38 AM
    • Member
      24 point Member
    • kabrown
    • Member since 05-16-2007, 5:20 PM
    • Posts 29

    Sorry for the delay.  I really don't know how to answer your questions.  Like I said, I'm pretty new to ASP and AJAX myself and still trying to make sense of it all.

    A web service "allows distributed applications to share business logic over a network".  You can use them in a variety of ways.  One of the few ways I've implemented them is using cascading dropdowns in the sample code I gave earlier.  There's lots of different ways to consume a web service, but I don't have much experience with them.  I did a search on consuming webservices and got tons of hits, this would probably be a better learning tool for you.

    As far as your specific questions about the code sample, perhaps a little more of the actual code would help make sense.  There are two drop downs.  The first has a data source and the datavaluefield is "RoleId".  RoleId is used by the serviceMethod "GetEmployeesByRole".  The two dropdowns are "tied" together within the cascading dropdown's code "parentcontrol=ddlRole" and "targetcontrol=ddlEmployee".

    Role: <asp:DropDownList ID="ddlRole" runat="server"

    DataSourceID="ods_Roles" DataTextField="RoleName" DataValueField="RoleId"

    OnSelectedIndexChanged="Page_Load" ToolTip="Narrow results by selecting a Role.">

    </asp:DropDownList>

     

    Volunteer:

    <asp:DropDownList ID="ddlEmployee" runat="server" ToolTip="Narrow results by selecting an employee(s)."></asp:DropDownList>

    <ajaxToolkit:CascadingDropDown ID="cddlEmployee" runat="server"

    Category="Roles" LoadingText="Please wait..."

    ParentControlID="ddlRole" PromptText="Select a Volunteer"

    TargetControlID="ddlEmployee"

    ServicePath="http://localhost:65269/OpenDoor/ODCService.asmx" ServiceMethod="GetEmployeesByRole" />

     

    <asp:ObjectDataSource ID="ods_Roles" runat="server"

    OldValuesParameterFormatString="original_{0}"

    SelectMethod="GetRoles"

    TypeName="dsRoleTableAdapters.RolesTableAdapter">

    </asp:ObjectDataSource>

     

    <asp:Button ID="Button2"

    runat="server" Text="Get Schedules" onClick="ddl_SelectedIndexChange"/>

    Good Luck!

  • Re: [Microsoft.Web.Script.Services.ScriptService()] - The type or namespace name 'Web' does not exist in the namespace 'Microsoft'

    06-30-2009, 11:25 AM
    • Member
      2 point Member
    • snowyinmn
    • Member since 06-30-2009, 3:23 PM
    • Posts 1

     I was having troubles with this too - after looking on the msdn website, I noticed that you need .NET 3.5, well I'm running on 2.0 so I'm out of luck.

  • Re: [Microsoft.Web.Script.Services.ScriptService()] - The type or namespace name 'Web' does not exist in the namespace 'Microsoft'

    07-02-2009, 7:25 AM
    • Member
      2 point Member
    • JamieKitson
    • Member since 07-02-2009, 7:24 AM
    • Posts 1

    You need to install Web Services Enhancements (WSE) 2.0 SP2 for Microsoft .NET

    http://www.microsoft.com/DOWNLOADS/details.aspx?familyid=FC5F06C5-821F-41D3-A4FE-6C7B56423841&displaylang=en

Page 2 of 2 (20 items) < Previous 1 2