Page 1 of 1
custom button in asp.net core designer
Posted: Sun Aug 17, 2025 5:14 pm
by Mike Avan
Hi
We are evaluating your asp.net core reporting component.
How can I add a custom button from js, to the designer on a razor page and then execute an action.
Any example code is appreciated.
Thanks
Re: custom button in asp.net core designer
Posted: Mon Aug 18, 2025 2:21 pm
by Lech Kulikowski
Hello,
You can use the following code:
Code: Select all
<script type="text/javascript">
jsStiNetCoreDesigner1.onready = function () {
var homePanel = jsStiNetCoreDesigner1.options.homePanel;
var buttonsGroup = jsStiNetCoreDesigner1.GroupBlock("buttonsGroup1", "Group1");
var buttonsGroupTable = jsStiNetCoreDesigner1.GroupBlockInnerTable();
buttonsGroup.container.appendChild(buttonsGroupTable);
var customBigButton = jsStiNetCoreDesigner1.BigButton("customButton1", null, "Custom Button", " ", "Tooltip for customButton1");
customBigButton.image.src = "https://www.stimulsoft.com/images/blocks/ultimate-buttons/logo.png";
buttonsGroupTable.addCell(customBigButton).style.padding = "2px";
customBigButton.action = function () {
alert("customButton was pressed!");
}
homePanel.firstChild.addCell(buttonsGroup);
homePanel.firstChild.addCell(jsStiNetCoreDesigner1.GroupBlockSeparator());
}
</script>
Thank you.
Re: custom button in asp.net core designer
Posted: Mon Aug 18, 2025 5:10 pm
by Mike Avan
Hello,
And how do you add button to be the first not the last as the above script suggests?
Thank you