I’ve got a Page which contains many deeply nested Controls of various types. Deep inside the hierarchy is an HtmlPanel. The HTML source in that box contains an element:
<div class="blue" onclick="App.MainPage.popRule(-1,"...");">...</div>
The topmost page is indeed called MainPage:
using Wisej.Core; using Wisej.Web; namespace X { public partial class MainPage : Page
and in that class there is a method:
[WebMethod] public void popRule(string fileId, string targetPolicy, string targetType = "RULE")
But when the div is clicked, the method is not called. While writing this out, I see that the method has a parameter with a default value, and re-factoring to eliminate the default-valued parameter fixes the problem.
So, what started out as a question becomes a suggestion: make the default parameter work, or at least update the documentation to indicate that it’s not supported.
Hello,
This is working as expected; default parameters are not supported for WebMethods.
We have updated the documentation internally and it will be pushed to the live site when the next version of Wisej.NET releases. You will then be able to view the updated documentation here: https://docs.wisej.com/api/wisej.core/general/wisej.core.webmethodattribute
-Julie
Please login first to submit.