Question: I am in the process of creating a new C# code snippet for the following:
IsReadOnly appears as a valid property in Intellisense under “this.AccountName.”
This is my code:
this.AccountName.isReadOnly = true;
But when I do this SalesLogix returns the following:
‘System.Web.UI.WebControls.TextBox’ does not contain a definition for ‘IsReadOnly’
Why is this happening?
Answer: A textbox exposes a property called “ReadOnly” not “IsReadOnly”. SalesLogix has a TextBoxControlAdapter that has an IsReadOnly property, which is then mapped to the ReadOnly property of the actual control. Application Architect is polling the Property from the Adapter rather than the actual control being rendered. This is the standard ASP.NET TextBox ( System.Web.UI.WebControls.TextBox ). Try the following instead: