bonjour a tous et merci d'avance.
Mon probleme est bien simple.
je declare une classe page1_2 dans un fichier page1_2.cs (voir ci dessous) contenant une fonction publique clic
Puis j ai mon fichier page1_2.aspx (ci-dessous) et un bouton qui appelle la fonction clicl. Pas d'erreur mais au click la fonction ne semble pas etre appelee.. :(
Qlq'un aurait une idee.. !?
PS : je suis un debutant en asp .net
///////////////
// page1_2.cs
//
using System;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
public class page1_2 : Page {
HtmlInputControl identite, tel;
Label msg;
public page1_2() {
identite = new HtmlInputText();
tel = new HtmlInputText();
msg = new Label();
}
public void clic(Object O, EventArgs E) {
msg.Text = "Merci <b>" + identite.Value + "</b><br>Numero -> <b>" + tel.Value + "</b>.";
}
}
///////
<%@ Page Language="C#" Inherits="page1_2" Src="page1_2.cs" %>
<html>
<head>
</head>
<body>
<form runat="server">
<p>
<strong><u>Contacts</u></strong>
</p>
<p>
<table height="150" width="300">
<tbody>
<tr>
<td>
Nom & Prenom</td>
<td>
<p align="center">
<input id="identite" type="text" runat="server" />
</p>
</td>
</tr>
<tr>
<td>
Telephone</td>
<td>
<p align="center">
<input id="tel" type="text" runat="server" />
</p>
</td>
</tr>
<tr>
<td>
</td>
<td>
<p align="center">
<input id="btn" type="button" value="Soumettre !" runat="server" onserverclick="clic" />
</p>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
</tr>
</tbody>
</table>
</p>
</form>
<asp:Label id="msg" runat="server"></asp:Label>
</body>
</html>
/////
Yafuka ( * _ * ) 