Sei sulla pagina 1di 2

DateTimeDateTime

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class _Default : System.Web.UI.Page


{

protected void Page_Load(object sender, EventArgs e)


{
if (!Page.IsPostBack)
{
ArrayList enc = new ArrayList();

ViewState.Add("encuentro", enc);

protected void Button1_Click(object sender, EventArgs e)


{
ArrayList encuentro = new ArrayList();
encuentro = (ArrayList) ViewState["encuentro"];
DateTime fecha =
Convert.ToDateTime(Calendar1.SelectedDate.ToShortDateString());
string rival = TextBox1.Text;
string estadio = TextBox2.Text;
string hora = TextBox3.Text;
encuentro.Add(new Encuentro(fecha, rival, estadio, hora));
ViewState["encuentro"] = encuentro;
ListBox1.Items.Add(Calendar1.SelectedDate.ToString());

}
}

Potrebbero piacerti anche