Skip to main content
Version: 4.1

WebMethodAttribute

Namespace: Wisej.Core

Assembly: Wisej.Framework (4.1.0.0)

Indicates that the method can be called from the browser using JavaScript.

public class WebMethodAttribute : Attribute

You can add this attribute to static methods in your Wisej application Program class and to instance methods in top level containers: Page, Form, and Desktop.

If you want to register web methods on child controls, you can, but Wisej only searches top level containers automatically. To register web methods on a child control, extend the control class, override OnWebRender and call RegisterWebMethods.


public class MyButton : Button
{
protected override void OnWebRender(dynamic config)
{
base.OnWebRender((object)config);
RegisterWebMethods(config);
}
}

Default parameters are not supported in Web Methods. This is supported:


[WebMethod]
public void myWebMethod(string s)

But this is not supported:


[WebMethod]
public void myWebMethod(string s = "default value")

Constructors

Instance member WebMethodAttribute()

Initializes the WebMethodAttribute attribute.

Instance member WebMethodAttribute(inheritable)

Initializes the WebMethodAttribute attribute.

NameTypeDescription
inheritableBooleanIndicates whether the web method is inherited by derived classes.

Properties

Instance member Inheritable

Boolean: Returns a value indicating whether the web method is inherited by derived classes.