About the author

Imran Imran
Like Development in DotNet.

E-mail me Send mail
Search Entire Web

Recent Articles

 
1: Master Pages
Category: ASP.Net
Added: 1/31/2008

 
2: Caching with ASP.NET
Category: ASP.Net
Added: 1/31/2008

 
3: Free Microsoft Press E-Book Offer!
Category: ASP.Net
Added: 1/30/2008

 
4: Timer Control in Asp.Net
Category: ASP.Net
Added: 1/29/2008

 
5: Checkbox selection with ajax
Category: ASP.Net
Added: 1/29/2008

 
6: UrlRewriter with asp.net
Category: ASP.Net
Added: 1/19/2008

 
7: Auto complete textbox with Ajax
Category: ASP.Net
Added: 1/15/2008

 
8: Upload file with Asp.Net
Category: ASP.Net
Added: 1/15/2008

 
9: User Rating Technique
Category: ASP.Net
Added: 1/8/2008

 
10: Encryption And Decryption Library
Category: ASP.Net
Added: 1/5/2008

Caching with ASP.NET

by Imran 31/January/2008

Caching with ASP.NET

ASP.NET supports three types of caching for Web-based applications:

  • Page Level Caching (called Output Caching)
  • Page Fragment Caching (often called Partial-Page Output Caching)
  • Programmatic or Data Caching

Private Sub Fill()

Dim dv As DataView = DirectCast(Cache("myobj"), DataView)

Dim ds As New DataSet

If dv Is Nothing Then

Dim sql As String = "SP_GET_Records"

ds = FillDS(sql)

dv = ds.Tables(0).DefaultView

Cache("myobj") = dv

End If

DataList1.DataSource = dv

DataList1.DataBind()

End Sub

Public Function FillDS(ByVal sql As String) As DataSet

Dim con As New SqlConnection(myConStr)

Dim da As New SqlDataAdapter(sql, con)Dim ds As New DataSet

da.Fill(ds)

con.Close()

Return ds

End Function





Powered by DotNetClassic.com