This topic is locked
[SOLVED]

 How to hide a button server side on a view/edit page?

6/27/2016 1:50:17 PM
ASPRunner.NET General questions
Pete K author

The help file details a useful technique for hiding buttons on a list page (data grid). I want to do the same thing, but on a single record page (view in this case). I have tried employing the same technique (wrapping the html element in {BEGIN/END MyButton} but then I can't seem to get any server-side code to work. The datagrid example uses

record["MyButton"] = true/false;


But of course the record array is not available in this context. I tried using

pageObject.hideField("MyButton");


which did not work.
So how can I control the visibility of a custom button server side?

Pete K author 7/11/2016

Anyone have any insight (or a guess) on this? I would really like to get it off my list.

admin 7/12/2016

Check this article http://xlinesoft.com/asprunnernet/docs/smarty_templates.htm, section named "{BEGIN} ... {END} blocks". You can show/hide it from BeforeDisplay event.

Pete K author 7/13/2016

Perfect! Thanks. I had the field block part, it was controlling it in code that had me stumped. So the key in this case is to use:
[font="Verdana"][size="2"]

[/size]



[/size]