ASP.NET: Politiche di Caching – Codice sorgente dell’esempio

Sorgenti: cache_file.aspx

Scarica i sorgenti: aspnet13.zip

Articolo a cui si riferisce il codice: ASP.NET: Politiche di Caching


1 < !DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”
2 “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
3
4 < %@Register TagPrefix=”ANet” TagName=”Footer” Src=”includes/footer.ascx”%>
5 < %@ Page Language=”VB” Debug=”True” %>
6
7 < %@ Import Namespace=”System.Xml” %>
8 < %@ Import Namespace=”System.Xml.Xsl” %>
9
10 < !
11 # nome: cache_file.aspx
12 # scritto da: Antonio Volpon
13 # data creazione: 30 Novembre 2001
14 # ultima modifica: 30 Novembre 2001
15 # copyright: Antonio Volpon
16 >
17
18 < script language=”vb” runat=”server”>
19
20
21 Public Sub Page_Load(sender As Object, e As EventArgs)
22
23 Dim objXml As New XmlDocument
24 Dim objXsl As New XslTransform()
25
26 If (IsNothing(Cache(“xml.xml”))) Then
27 risposta.innerText = “Elemento non presente in cache…lo carico”
28 PopolaCache(“xml.xml”)
29 Else
30 risposta.innerText = “Elemento già presente in cache”
31 End If
32
33 objXsl.Load(Server.MapPath(“xsl.xsl”))
34
35 objXml = CType(Cache(“xml.xml”), XmlDocument)
36
37 libri.Document = objXml
38 libri.Transform = objXsl
39
40 End Sub
41
42 Public Sub PopolaCache(strFileXml As String)
43
44 Dim objXml As New XmlDocument
45
46 objXml.Load(Server.MapPath(strFileXml))
47
48 Dim objCDep as new CacheDependency(Server.MapPath(strFileXml))
49
50 Cache.Insert(strFileXml, objXml, objCDep)
51
52 End Sub
53
54 script>
55
56
57 < html>
58
59 < head>
60 < link rel=”stylesheet” href=”css/aspnet.css” type=”text/css”>
61 link>
62 < title>DataReadertitle>
63 head>
64
65 < body>
66
67 < div class=”titolo”>
68 DataReader
69 div>
70
71 < hr noshade=”noshade” size=”1″ width=”100%” />
72
73 < asp:xml id=”libri” runat=”server”/>
74
75 < div class=”txtb” id=”risposta” runat=”server”>div>
76
77 < ANet:Footer id=”Menu” runat=”server” />
78
79 body>
80
81 html>

Tag: , ,
  • ASP.NET: Politiche di Caching
    ASP.NET introduce un sofisticato meccanismo di caching, attivo sia a livello di pagina, sia di oggetti. Offre la possibilità di legare la permanenza in cache utilizzando dipendenze temporali o tra oggetti ...
  • ASP.NET e Xml – Codice sorgente dell’esempio
    Sorgenti: LeggiXml.aspx Scarica i sorgenti: aspnet11.zip Articolo a cui si riferisce il codice: ASP.NET e Xml LeggiXml.aspx   1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"   2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">   3    4 <%@ Page Language="VB" Debug="True" %>   5    6 <%@ Import Namespace="System.Data" %>   7 <%@ Import Namespace="System.Data.OleDb" %>   8    9 <%@ Register TagPrefix="ANet" TagName="Footer" Src="includes/footer.ascx"%>  10   11 <!–  12 # nome: XMLLeggi.aspx  13 # scritto da: Antonio [...]...
  • ASP.NET: DataReader e DataSet – Codice sorgente dell’esempio
    Sorgenti: DataReader.aspx – DataSet.aspx – Connessione.ascx Scarica i sorgenti: aspnet10.zip Articolo a cui si riferisce il codice: ASP.NET: DataReader e DataSet DataReader.aspx   1   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"   2   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">   3    4 <%@ Page Language="VB" Debug="True" %>   5    6 <%@ Import Namespace="System.Data" %>   7 <%@ Import Namespace="System.Data.OleDb" %>   8    9 <%@ Register TagPrefix="cnn" TagName="connection" Src="connessione.ascx" %>  10 <%@ Register TagPrefix="ANet" [...]...
  • ASP.NET: differenze con ASP – Codice sorgente dell’esempio
    Sorgenti: primaPagina.aspx – footer.ascx Scarica i sorgenti: aspnet01.zip Articolo a cui si riferisce il codice: ASP.NET: differenze con ASP primaPagina.aspx 1 <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” 2 “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”> 3 4 <%@Page Language=”VB”%> 5 <%@Register TagPrefix=”ANet” TagName=”Footer” src=”includes/footer.ascx”%> 6 7 <!– 8 # nome: primaPagina.aspx 9 # scritto da: Antonio Volpon 10 # data [...]...
  • ASP.NET: Web Form Controls e gli eventi – Codice sorgente dell’esempio
    Sorgenti: TextBox.aspx Scarica i sorgenti: aspnet05.zip Articolo a cui si riferisce il codice: ASP.NET: Web Form Controls e gli eventi TextBox.aspx – Prova l’esempio [nuova finestra]   1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"   2   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">   3    4 <%@Page Language="VB"%>   5 <%@Register TagPrefix="ANet" TagName="Footer" Src="includes/footer.ascx"%>   6    7 <!–   8 # nome: TextBox.aspx   9 # scritto da: Antonio Volpon  10 # data creazione: 25 [...]...

Scrivi un commento

Non è possibile inserire commenti per questo intervento.