Correction EFM
Correction EFM
Correction EFM
Question 1 A
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Connection.aspx.cs" Inhe
rits="MvcApplication4.Connection" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<div class="form-group">
<label for="TextBoxPW">mot de passe:</label>
<asp:TextBox ID="TextBoxPW" runat="server" CssClass="form-
control" TextMode="Password"></asp:TextBox>
</div>
<asp:Button ID="Button1" runat="server" Text="connexion" CssClass="btn btn
-primary btn-block" OnClick="Button1_Click" />
<asp:Label ID="LabelInfo" runat="server" Text="Label" style="color:red" ></as
p:Label>
</div>
</form>
</body>
</html>
Question 1 B et c
protected void Button1_Click(object sender, EventArgs e)
{
string strcn = @"data source=localhost;initial catalog=EFM_ASP_Co
rrection;integrated security=true";
------------------------------------------------------------------------------
1) Mes Tâches :
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="mesTaches.aspx.cs" In
herits="MvcApplication4.mesTaches" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server" >
<div>
<asp:Label ID="LabelInfo" runat="server" Text="Label"></asp:Label>
<h1>mes taches</h1>
<asp:HiddenField ID="HiddenFieldMatricule" runat="server" />
<asp:GridView ID="GridViewTaches" runat="server"></asp:GridView>
<label id="nbTaches"></label>
</div>
</form>
//question 3 A et B
<script>
window.addEventListener("DOMContentLoaded", getNbTaches);
function getNbTaches() {
let valMatricule = document.getElementById("HiddenFieldMatricule").value;
let matricule = { Data: valMatricule };
console.log(matricule);
let xhr = new XMLHttpRequest();
xhr.open("GET", "http:www.rhMaroc.net/Taches");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Accept", "*/*");
xhr.send(JSON.stringify(matricule))
xhr.onload = function () {
}
}
</script>
</body>
</html>
Question 2 A et b