Question: I have a Checkbox and a Dropdownlist (with a 'All' as first element) like so :

```
<td style="width: 15px">
   <asp:CheckBox ID="isAdvertiserFilter" runat="server" AutoPostBack="false"/>
</td>
<td style="width: 330px">
    <asp:DropDownList ID="AdvertiserFilterList" runat="server" DataTextField="Name" DataValueField="Id" AutoPostBack="true" Enabled="false"/>
</td>

```

The checkbox enable/disable the dropdownlist.

When enabled, the user can select any item in the list (All, Item1, Item2...) The event is handled in the code behind :

```
this.AdvertiserFilterList.SelectedIndexChanged += new EventHandler(SearchFilter);

```

So, when the user Uncheck the checkbox I want the dropdownlist to be set to 'All' and be disabled. In my javascript when I set to "All" (value -1, index 0) It doesn't trigger the event of the code behind to call my SearchFilter function.

```
$(document).on({
click: function (event) {
    if ($(event.target).is('#isAdvertiserFilter'))
    {
        // Enable or disable the dropdowlist
        $('select[id*="AdvertiserFilterList"]').attr("disabled", !$('input[id*="isAdvertiserFilter"]').prop("checked"));
        // When UNcheck
        if (!$('input[id*="isAdvertiserFilter"]').prop("checked")) {
            // Set to the dropdownlist to All
            $('select[id*="AdvertiserFilterList"]').val("-1");
            // Trying to fire the event
            $('select[id*="AdvertiserFilterList"]').trigger("change");

        }
    }
},
});

```

How to call my codebehind or trigger the event as if the user did it ? 

I want to PostBack only when the checkbox is UNcheck (and not check) or when the dropdowlist 'SelectIndexChanged'

Answer: 
I think what you're trying to achieve can best be done using the `lazy` function to lazily initialise a value when first requested. See [here](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/lazy.html) for details.

e.g.

```
companion object {
    val instance: GameDAO by lazy { GameDAO() }
}

```

You don't need a separate `getInstance` function: you can just access the `instance` property directly, and it'll be initialised on first request (in a thread-safe way).

This is assuming that you only want the object to be initialised when first requested (i.e. lazily initialised). If you want it to always be created then you can just construct it and assign it to a variable/property immediately.
```
object GameDao {
    fun hereGoesYourFunctions()
}

```

calling hereGoesYourFunctions will initialize the GameDao class.