[C#] Control user dans le code caché
Bonjour je souhaite créer un controle utilisateur mais j aimerais pouvois avoir acces au diférente methode .
j'ai fait ca dans un fichier User.ascx
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
namespace Authentification
{
using System;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
/// <summary>
/// Description résumée de [!output SAFE_CLASS_NAME].
/// </summary>
public abstract class User : System.Web.UI.UserControl
{
protected System.Web.UI.WebControls.TextBox TextBox1;
protected System.Web.UI.WebControls.TextBox TextBox2;
protected System.Web.UI.WebControls.Button Button1;
public string BackColor = "write";
public string idUtilisateur
{
get
{
return TextBox1.Text;
}
set
{
TextBox1.Text = value;
}
}
public string MotDePasse
{
get
{
return TextBox2.Text;
}
set
{
TextBox2.Text = value;
}
} |
Mais je ne peux le parametre que dans un fichier aspx
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
<%@ Page language="c#" Codebehind="WebForm3.aspx.cs" AutoEventWireup="false" Inherits="Authentification.WebForm3" %>
<%@ Register TagPrefix="AA" TagName="Identif" Src="User.ascx" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
<title>WebForm3</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio 7.0">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</head>
<body MS_POSITIONING="GridLayout">
<form id="WebForm3" method="post" runat="server">
<AA:Identif id="MonIdentif" IdUtilisateur="noham" MotDePasse="moimoi" BackColor="beige" runat="server" />
</form>
</body>
</html> |
comment fair pour le avoir access dans le fichier aspx.cs
Merci
[Tags [ASPX][C#] corrigé par freegreg - Ancien tag : [ASP.NET][C#] ]
[Pensez-y, vous-même, la prochaine fois. Merci ;)]