<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Update.aspx.cs" Inherits="Update" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="
http://www.w3.org/1999/xhtml"><head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h1>Ude af drift
</h1>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:button ID="Button1" runat="server" text="Button" onclick="Button1_Click" />
</div>
</form>
</body>
</html>
koden bag ved
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.ComponentModel;
using System.Media;
using System.Web.SessionState;
using System.Web.UI.HtmlControls;
public partial class Update : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
if (TextBox1.Text == "hej")
{
Button1.Text = "hej";
}
else
{
Button1.Text = "ERROR";
//her skal der afspilles en lyd
}
}
}
Hvordan får jeg den til at afspille en lyd når den smutter i else?