How to write a Cookie
<script language="c#" runat="server">
private void Page_Load(object sender, System.EventArgs e)
{
HttpCookie cookie = new HttpCookie("UID");
cookie.Value = "myid";
cookie.Expires = Convert.ToDateTime("10/12/2005");
Response.Cookies.Add(cookie);
cookie = new HttpCookie("PASS");
cookie.Value = "mypass";
cookie.Expires =Convert.ToDateTime("10/12/2005");
Response.Cookies.Add(cookie);
}
</script>
<HTML>
<body>
<form id="Form1" method="post" runat="server">
<asp:ListBox id="ListBox1" runat="server" Width="341px" Height="169px"></asp:ListBox>
</form>
</body>
</HTML>
Download Code...
Print Page