Steps to Reproduce the Behavior
Install Windows 2000 SP4
If Windows 2000 SP4 is not already installed on your Windows 2000-based
computer, visit the following Microsoft Web site:
Install the .NET Framework 1.1
To download and to install the .NET Framework 1.1, visit the
following Microsoft Web site:
Create a New ASP.NET Web Application
- Create a new ASP.NET Web application by using Microsoft
Visual C# .NET or Microsoft Visual Basic .NET. Name the project StateServApp. By default, WebForm1.aspx is
created.
- Add a TextBox control and two
Button controls to WebForm1.aspx.
- Add the following code to the Button_click event of the Button1 control:
Visual C# .NETSession["var1"]=TextBox1.Text;
Visual Basic .NET
Session("var1")=TextBox1.Text
- Add the following code to the Button_click event of the Button2 control:
Visual C# .NET
Response.Write("Value retrieved from the Session Variable: " + Session["var1"])
Visual Basic .NETResponse.Write("Value retrieved from the Session Variable: " + Session("var1"))
Configure the State Service
By default, ASP.NET stores the session state in the same process
that processes the request. Additionally, ASP.NET stores the session data in an
external process such as
aspnet_state. To enable this feature, follow these steps:
- In Solution Explorer, double-click the Web.config file to
edit the file.
- Set the mode attribute of the <sessionState> section to StateServer, and then configure the stateConnectionString attribute with the following values of the computer where you
started aspnet_state:
<configuration>
<system.web>
<sessionState mode="StateServer"
stateConnectionString="tcpip=localhost:42424"
/>
</system.web>
</configuration>
Note If the state service is running on the remote computer, type the
remote computer name instead of localhost. - Save and then close the Web.config file.
- On the Build menu in Microsoft Visual
Studio, click Build Solution.
- To start the ASP.NET State Service, follow these steps:
- Click Start, point to Programs, point to Administrative Tools, and then click Services.
- In the right pane of the Services window, right-click the ASP.NET State Service service, and then click Start.
- To run the ASP.NET application, follow these steps:
- In a Web browser, type the following
URL:
http://localhost/StateServ/WebForm1.aspx
- In the box, type This text is from the session variable.
- To assign the text in the box to the session variable,
click the Button1 control.
- To display the text that is stored in the session
variable, click the Button2 control.
- To stop the ASP.NET State Service, follow these steps:
- Click Start, point to Programs, point to Administrative Tools, and then click Services.
- In the right pane of the Services window, right-click the ASP.NET State Service service, and then click Stop.
Install the .NET Framework 1.0 SP2
To download and to install the .NET Framework 1.0 SP2, visit
the following Microsoft Web site:
Start the State Service
To start the ASP.NET State Service, follow these steps:
- Click Start, point to Programs, point to Administrative Tools, and then click Services.
- In the right pane of the Services window, right-click the ASP.NET State Service service, and then click Start.
You receive the error message that is mentioned in the
"Symptoms" section of this article.