using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class andmed1 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { // GridView1.DataSource = new string[] { "Juku", "Kati", "Mati" }; GridView1.DataSource = new string[] { "Juku", "Kati", "Mati" }. Select(x => new{alg=x.Substring(0, 1), sisu=x}); GridView1.DataBind(); try { HttpContext.Current.Session["loendur"] = (Convert.ToInt32(HttpContext.Current.Session["loendur"])+1).ToString(); } catch (Exception ex) { HttpContext.Current.Session["loendur"] = "1"; } if (HttpContext.Current.Session["loendur2"] != null) { HttpContext.Current.Session["loendur2"] = (int)HttpContext.Current.Session["loendur2"] + 1; } else { HttpContext.Current.Session["loendur2"] = 1; } Label1.Text = HttpContext.Current.Session["loendur2"].ToString(); } }