Calling web services from JavaScript in BBIS

Create your web service (asmx) and put it in the NetCommunity\WebServices folder.


Imports System.Web.Services
Imports System.ComponentModel
Imports System.Web.Script.Services

Public Class MyCustomWebService
    Inherits System.Web.Services.WebService

    Public Function GetText(ByVal name As String) As String
        name = HttpUtility.UrlDecode(name)

        Return "Hello " + name
    End Function
End Class

No you can call this method in your web service from your JavaScript like below.

function callGetText(name) {
    var params = {}; = encodeURIComponent(name);

    callWebMethod("GetText", params);

function callWebMethod(webmethod, params) {
    function onFail(jqXHR, textStatus, errorThrown) {

    function onSuccess(data, textStatus, jqXHR) {

    BLACKBAUD.netcommunity.CallWebServiceMethod("MyCustomWebService", webmethod, onSuccess, onFail, JSON.stringify(params));

Now you can just call GetText(“Chris”) and it will then alert you, “Hey Chris”.

Happy Coding. 🙂

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s