Is it possible to call the void return method in an expression to bind data? (To set a global variable, for example.)The following does not compile:
<%# setCurrent(false) %> // Error: Cannot implicitly convert type 'void' to 'object'
I could change the return type of the method (for example, return a null object to it), but this will cheat.
The whole point of data binding is that a value is returned for display. (hence the error)
Just return an empty string :)
I think putting a semicolon after your statement should make it semantically correct:
setCurrent(false);
This is not a “data binding” as such, but it works.