onenter Event

             

Occurs at the beginning of ASP page processing on the server. Available only in server script.

Syntax

object_onenter

Parameters

object

A PageObject script object.

Remarks

The onenter event occurs when an ASP is first processed on the server. This happens when a user navigates to the page as well as each time the page is posted to the server.

When targeting the client (IE 4.0 DHTML) scripting platform, the window onload event can be used to implement the same kind of initialization code that onenter provides on the server.

Example

In the following example, the event handler adds items to an existing Listbox object named Listbox1 and sets the default selection to "Cars" each time thisPage is first processed on the server.

function thisPage_onenter()
{
   if (thisPage.firstEntered)
   {
      ListBox1.addItem("Cars", 1);
      ListBox1.addItem("Planes", 2);
      ListBox1.addItem("Trains", 3);
      ListBox1.selectByValue(1);
   }
}