JavaScript Editor Ajax toolkit     Ajax website 

Main Page

An expression references a member of a class-based object, but the object does not have a member with that name.

If the code is contained in an ASP.NET page, the code might define a constructor function within a <script runat="server"> block that uses the this statement. The expando modifier should be applied to every constructor function definition in a <script runat="server"> block.

For example, the following code for an ASP.NET page uses a constructor function marked with the expando modifier.

В CopyCode imageCopy Code
<script runat="server">
expando function Person(name) {
   // If the expando modifier was not applied to the definition of Person,
   // the this statment in the following line of code would generate error
   // JS1151 = name;

var fred = new Person("Fred");

To correct this error

  1. Make sure that the expression references an existing member of the class-based object and that the member name is correctly spelled.

  2. Make sure to apply the expando modifier to each constructor function declaration in a <script runat="server"> block.

See Also


this Statement
expando Modifier


Troubleshooting Your Scripts

Other Resources

JScript Reference
Class-based Objects

JavaScript Editor Ajax toolkit     Ajax website