I would like to have an aspx page that contains something like….
<form id='form1' runas=server > Hello <%= Me.UserName() %> </form>
and a code-behind something like…
Public Class Somepage inherits SomeOtherPage Private Readonly Property UserName() as String Get return 'Rory' End Get End Property End Class
I have tried this code but the aspx errors claiming that UserName is not declared.
What is the proper way to do this?
Mark the property as Protected, not Private.