Thursday, June 21, 2012

Using Cache in ASP.NET


if (Cache["Name"] != null)

Label1.Text = "Hello," + (string)Cache["Name"];

else

Label1.Text = "Hello, guest! ";


Setting Cache Expiry


Cache.Insert("Name", "Kevin", null, DateTime.Now.AddMinutes(10), TimeSpan.Zero);



3 comments:

  1. To make it fun, you can use int number variables or code date to define the day and time of day. One of the many tips you'll find in web development company sydney, where code templates are available.

    ReplyDelete
    Replies
    1. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a .Net developer learn from Dot Net Training in Chennai. or learn thru ASP.NET Essential Training Online . Nowadays Dot Net has tons of job opportunities on various vertical industry.
      or Javascript Training in Chennai. Nowadays JavaScript has tons of job opportunities on various vertical industry.

      Delete
  2. It's a good thing we have web design and development team that handles this thing. I don't want to add these complications in my heavy work load.

    -Gwyn Stiles

    ReplyDelete