Search Persits Software Knowledge Base

 

Article PS01111073

Index out of range error

Problem Description

When using data-bound forms with AspGrid, a line such as

<TD><% = Row(3).Value %></TD> :

may generate the following error:

Persits.Grid.1 (0x800A0027)
Index out of range.

Solution

The form methods (GET or POST) used by a button invoking the Add New mode and the actual data-bound form must match. In our sample files list.asp and form.asp the Add New button is implemented by the following code:

<FORM ACTION="form.asp">
<INPUT TYPE="HIDDEN" NAME="AspGridAdd1" VALUE="1">
<INPUT TYPE="SUBMIT" VALUE="Add New">
</FORM>

The form method is GET by default. The data-bound form implemented by form.asp also uses the GET method. If you choose to use the POST method in form.asp by setting the property

Grid.MethodGet = False

you must also specify the POST method for your Add New button, as follows:

<FORM ACTION="form.asp" METHOD="POST">
...
</FORM>

Created: 2/8/2002 4:59:01 AM
Last Modified: 2/9/2002 4:18:02 PM

Copyright © Persits Software, Inc. 1998 - 2018
For technical support, write to support@persits.com.