Lab 6 Code Implementation

This lab demonstrates three ASP.NET techniques:

Problem 1: Hidden Field

<asp:HiddenField ID="hiddenW" runat="server" Value="43854" />
' VB.NET code:
lblResult.Text = "Value of W: " & hiddenW.Value
    

Problem 2: Query String Transfer

' Redirect with query string:
Response.Redirect("Form2.aspx?cid=" & customerId & "&cname=" & customerName)
    

Problem 3: Persistent Cookie

' Create cookie:
Dim cookie As New HttpCookie("CustomerInfo")
cookie("Name") = txtName.Text
cookie.Expires = DateTime.Now.AddYears(1)
Response.Cookies.Add(cookie)