Utilizzare il controllo <asp:ImageButton>

FAQ di programmazione in .NET

Utilizzare il controllo <asp:ImageButton>

Messaggioda alesslud » mar mag 30, 2006 3:36 pm

<%@ Page Language="VB" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Xml" %>
<script runat="server">

Sub Page_load
Dim dstRecipes As DataSet
Dim objDataDocument As XmlDataDocument
Dim objRecipes As XmlNodeList
Dim objRecipe As XmlNode

dstRecipes = New DataSet()
dstRecipes.ReadXml( MapPath( "dati.xml" ) )

objDataDocument = New XmlDataDocument( dstRecipes )
objRecipes = objDataDocument.GetElementsByTagName( "default" )
For Each objRecipe In objRecipes
if lblOutput.Text <> "" then
lblOutput.Text = ""
end if
lblOutput.Text &= objRecipe.InnerXml
Next
End Sub


Sub ImageButton_home( s As Object, e As ImageClickEventArgs )
Dim dstRecipes As DataSet
Dim objDataDocument As XmlDataDocument
Dim objRecipes As XmlNodeList
Dim objRecipe As XmlNode

dstRecipes = New DataSet()
dstRecipes.ReadXml( MapPath( "dati.xml" ) )

objDataDocument = New XmlDataDocument( dstRecipes )
objRecipes = objDataDocument.GetElementsByTagName( "default" )
For Each objRecipe In objRecipes
if lblOutput.Text <> "" then
lblOutput.Text = ""
end if
lblOutput.Text &= objRecipe.InnerXml
Next
End Sub


Sub ImageButton_Click( s As Object, e As ImageClickEventArgs )

Dim dstRecipes As DataSet
Dim objDataDocument As XmlDataDocument
Dim objRecipes As XmlNodeList
Dim objRecipe As XmlNode

dstRecipes = New DataSet()
dstRecipes.ReadXml( MapPath( "dati.xml" ) )

objDataDocument = New XmlDataDocument( dstRecipes )
objRecipes = objDataDocument.GetElementsByTagName( "siamo" )
For Each objRecipe In objRecipes
if lblOutput.Text <> "" then
lblOutput.Text = ""
end if
lblOutput.Text &= objRecipe.InnerXml
Next
End Sub

</script>
<html>
<head>
<title>TER- S.p.a</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
<meta http-equiv="Content-Language" content="it" />
<meta content="Microsoft FrontPage 4.0" name="GENERATOR" />
<meta content="FrontPage.Editor.Document" name="ProgId" />
<link href="stile.css" type="text/css" rel="stylesheet" />
</head>
<body>
<div id="C">
<form runat="server">
<table height="238" cellspacing="0" cellpadding="0" width="98%" border="0">
<tbody>
<tr>
<td valign="top" align="left" width="357" height="195">
<img height="195" src="woods3.jpg" width="357" border="0" /></td>
<td width="357">
<img height="193" src="barca.jpg" width="357" border="0" /></td>
<td align="left">
<img src="logo1.jpg" border="0" /></td>
</tr>
<tr>
<td valign="top">
<br />
<br />
<asp:ImageButton ImageUrl="~/mission.jpg" OnClick="ImageButton_home" runat="server" />
<br />
<asp:ImageButton ImageUrl="~/siamo.jpg" OnClick="ImageButton_Click" runat="server" />
<br />
<a href=""><img src="news.jpg" border="0" /></a>
<br />
<a href=""><img src="job.jpg" border="0" /></a>
<br />
<a href=""><img src="forum.jpg" border="0" /></a>
<br />
<a href=""><img src="ternet.jpg" border="0" /></a>
<br />
<a href=""><img src="clienti.jpg" border="0" /> </a></td>
<td colspan="2">
<font class="textitle">Questa è una prova d'inserimento del titolo<br />
<br />
<br />
</font><font class="text"><asp:Label id="lblOutput" runat="Server"></asp:Label></font></td>
</tr>
</tbody>
</table>
</form>
</div>
<div id="B">
<table>
<tbody>
<tr>
<td width="230">
<font class="footer"><b>SEDE SOCIALE:</b> Via Calabria, 25 - 00187 Roma</font>
</td>
<td width="180">
<font class="footer"><b>C.F. - P.IVA:</b> 03864801000</font>
</td>
<td width="180">
<font class="footer"><b>TELEFONO: +39.06.42 02 04 62</b></font>
</td>
<td width="180">
<font class="footer"><b>FAX:</b> +39.06.42 01 61 14</font>
</td>
<td width="195">
<font class="footer"><b>POSTA ELETTRONICA:</b> segreteria@ter.it</font>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>
alesslud
Site Admin
 
Messaggi: 779
Iscritto il: mer nov 08, 2006 8:09 am

dati.xml

Messaggioda alesslud » mar mag 30, 2006 3:37 pm

<?xml version="1.0" encoding="utf-8" ?>
<root>
<contenitore>
<nome>
French Toast
</nome>
<ingredientei>
<ingrediente>
Bread
</ingrediente>
<ingrediente>
Butter
</ingrediente>
<ingrediente>
Sugar
</ingrediente>
</ingredientei>
</contenitore>
<contenitore>
<nome>
Tomato Soup
</nome>
<ingredientei>
<ingrediente>
Tomatoes
</ingrediente>
<ingrediente>
Water
</ingrediente>
</ingredientei>
</contenitore>
</root>
alesslud
Site Admin
 
Messaggi: 779
Iscritto il: mer nov 08, 2006 8:09 am


Torna a .NET

Chi c’è in linea

Visitano il forum: Nessuno e 1 ospite

cron