All Namespaces

  • Namespaces
    • AjaxControlToolkit
    • com
    • CrystalDecisions
    • DevExpress
    • DocumentFormat
    • Dundas
    • Ilrun
    • MediaCenter
    • Microsoft
    • MS
    • ServiceBus
    • Spaanjaars
    • SqlContracts
    • System
      • Activities
      • AddIn
      • CodeDom
      • ComponentModel
      • Configuration
      • Data
      • Design
      • Diagnostics
      • DirectoryServices
      • Drawing
      • Dynamic
      • EnterpriseServices
      • IdentityModel
      • IO
      • Linq
      • Management
      • Messaging
      • Net
      • Printing
      • Reflection
      • Resources
      • Runtime
      • Security
      • ServiceModel
      • ServiceProcess
      • Timers
      • Transactions
      • Web
        • Compilation
        • DynamicData
        • Hosting
        • Mobile
        • Mvc
        • Profile
        • Razor
        • Script
          • Serialization
          • Services
        • Services
        • UI
        • WebPages
      • Windows
      • Workflow
      • Xml
    • WindowsFormsIntegration

ScriptServiceAttribute

Name: ScriptServiceAttribute
Namespace: System.Web.Script.Services
Inherits from: System.Attribute
Short description: Indicates that a Web service can be invoked from script. This class cannot be inherited.
Added: 2009-02-14
Last modified: 2009-06-14
External help: http://msdn.microsoft.com/en-us/library/System.Web.Script.Services.ScriptServiceAttribute.aspx
Added by: Imar Spaanjaars
Can be used on:
Assembly Class Interface
Method Property Field
Constructor Struct Enum
Event Parameter Delegate
ReturnValue Generic Parameter Module
Available in:
  • 3.5.0.0
  • 4.0.0
  • 4.0.0.0
  • 4.5.0.0
Defined in:
  • System.Web.Extensions.dll (3.5.0.0)
  • System.Web.Extensions.dll (4.0.0.0)
Abstract?
No Sealed? Yes
Public?
Yes Internal? No
Allow multiple?
No Obsolete? No
 
Full description:
 
Class diagram:
This diagram is autogenerated and may contain errors.
Please report them if you find them.




Code examples

Below you find a list of code examples that have been added for this attribute.


Language: VB.NET    Posted by: Imar Spaanjaars    Date added: 6/14/2009

The following code snippet shows a web service that is also callable from client side script like ASP.NET AJAX because it has the ScriptService attribute applied:

<System.Web.Script.Services.ScriptService()> _
<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class Service
    Inherits System.Web.Services.WebService

  <WebMethod()>
  Public Function HelloWorld() As String
    Return "Hello World"
  End Function
End Class




Language: C#    Posted by: Imar Spaanjaars    Date added: 6/14/2009

The following code snippet shows a web service that is also callable from client side script like ASP.NET AJAX because it has the ScriptService attribute applied:

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.Web.Script.Services.ScriptService]
public class Service : System.Web.Services.WebService
{
  [WebMethod]
  public string HelloWorld()
  {
    return "Hello World";
  }
}



If you want to add a code example, you need to log in first. Don't have account? You can sign up for one right now.

Links

No links found.



If you want to add a link, you need to log in first. Don't have account? You can sign up for one right now.