!!! Listing 1
<%@ Page language="c#" Codebehind="WebForm1.aspx.cs"
AutoEventWireup="false" Inherits="WebApplicationIx.WebForm1" %>
!!! Linie ziehen
// C#-Code mit der Ereignisbehandlung (Ausschnitt)
private void Button1_Click(object sender, System.EventArgs e)
{
Label1.Text = "Danke";
}
!!! Listing 2
!!! Listing 3
<%@ Page language="c#" Codebehind="WebForm1.aspx.cs"
AutoEventWireup="false" Inherits="IxPHP.WebForm1" %>
// C#-Code zur XML-Verarbeitung. Die
// Ereignisverarbeitung findet in Page_Load
// statt (ohne Designer-Code)
private void Page_Load(object sender, System.EventArgs e)
{
DataSet ds = new DataSet();
ds.ReadXml(Server.MapPath("Telephone.xml"), XmlReadMode.Auto);
DataGrid1.DataSource = ds;
DataGrid1.DataMember = "Mitarbeiter";
DataGrid1.DataBind();
}
name | mobil | fest |
Franz Bergmann | 0172/1234568 | 030/3456789 |
Martin Müller | 0174/67821313 | 089/09878654 |
Sylvio Ehnes | 0160/1234568 | 040/12312312 |
!!! Listing 4
public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.DropDownList DropDownList1;
private void Page_Load(object sender, System.EventArgs e)
{
OdbcConnection conn = new OdbcConnection("DSN=MySQLDSN");
conn.Open();
OdbcCommand comm = new OdbcCommand("SELECT id, newstext FROM
comzept_user_news", conn);
OdbcDataReader reader = comm.ExecuteReader();
this.DropDownList1.DataSource = reader;
this.DropDownList1.DataTextField = "newstext";
this.DropDownList1.DataValueField = "id";
this.DropDownList1.DataBind();
}
}
!!! Listing 5