Hide add button on single record

This public forum is for user-to-user discussions of ASP.NET Maker. Note that this is not support forum.
Post Reply
crash
User
Posts: 148

Hide add button on single record

Post by crash »

I am converting my old aspmaker to aspmaker dot net

Previously I was able to hide the add button if already had a single record. I am now not sure how to load this code.
Can anyone help with this code please. Current code is not working. Thanks

// Page Load event
public void Page_Render() {

If Page.TotalRecs = "1" Then
Set item = AddEditOptions.GetItem("add")
item.Visible = False

}


MichaelG
User
Posts: 1095

Post by MichaelG »

You should learn the C# syntax and convert your classic ASP codes accordingly.


crash
User
Posts: 148

Post by crash »

I've tried another option now. Why would this not be working. I'm still getting to know C#

I need to hide the add button

// Page Load event
public void Page_Render() {
//Log("Page Render");

if (CurrentUserName() == "xxx" && CurrentTable.Name == "xxxRegisterlist")
ListOptions ["add"] .Visible = false;


}


MichaelG
User
Posts: 1095

Post by MichaelG »

You can easily debug your codes by opening the project in Visual Studio 2022 and adding a break point to your server event codes.


Post Reply