IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

ASP.NET Discussion :

Ajax et ASP.NET


Sujet :

ASP.NET

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé
    Profil pro
    Inscrit en
    Mai 2002
    Messages
    131
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2002
    Messages : 131
    Par défaut Ajax et ASP.NET
    Bonjour

    J'ai placé 12 objets Button et 12 objets Panel sur un UpdatePanel.
    Au click d'un bouton, un panel apparait (sur l'évenement OnClik, le panel
    précédent devient invisible, et le nouveau panel devient visible)

    Est-ce normal que malgré l'objet ScriptManager et l'UpdatePanel, quand je clique sur un bouton, la fenêtre se rafraichit ?
    Il me semblait qu'avac Ajax, il n'y avait aucun rafraichissement

    Merci d'avance pour votre aide :-)

  2. #2
    Rédacteur
    Avatar de lutecefalco
    Profil pro
    zadzdzddzdzd
    Inscrit en
    Juillet 2005
    Messages
    5 052
    Détails du profil
    Informations personnelles :
    Âge : 45
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : zadzdzddzdzd

    Informations forums :
    Inscription : Juillet 2005
    Messages : 5 052
    Par défaut
    Citation Envoyé par asenaici Voir le message
    Bonjour

    J'ai placé 12 objets Button et 12 objets Panel sur un UpdatePanel.
    Au click d'un bouton, un panel apparait (sur l'évenement OnClik, le panel
    précédent devient invisible, et le nouveau panel devient visible)

    Est-ce normal que malgré l'objet ScriptManager et l'UpdatePanel, quand je clique sur un bouton, la fenêtre se rafraichit ?
    Il me semblait qu'avac Ajax, il n'y avait aucun rafraichissement

    Merci d'avance pour votre aide :-)
    Fais voir ton code

  3. #3
    Membre confirmé
    Profil pro
    Inscrit en
    Mai 2002
    Messages
    131
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2002
    Messages : 131
    Par défaut
    Bonjour

    Ci-joint les codes des fichiers GestionAgenda.aspx et GestionAgenda.cs

    fichier GestionAgenda.aspx :

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="GestionAgenda.aspx.cs" Inherits="GestionAgenda" StyleSheetTheme="Thème1" %>

    <%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

    <%@ Register assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" namespace="System.Web.UI" tagprefix="asp" %>

    <!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>Page sans titre</title>
    <style type="text/css">
    .style1
    {
    width: 103%;
    height: 190px;
    }
    .style4
    {
    height: 10px;
    width: 53px;
    }
    .style6
    {
    height: 10px;
    width: 246px;
    }
    .style7
    {
    width: 246px;
    }
    .style8
    {
    height: 10px;
    }
    .style9
    {
    width: 30px;
    }
    .style10
    {
    height: 10px;
    }
    .style11
    {
    width: 76px;
    }
    .style12
    {
    height: 10px;
    width: 11px;
    }
    .style13
    {
    width: 11px;
    }
    .style14
    {
    width: 53px;
    }
    .style15
    {
    height: 10px;
    text-align: center;
    font-weight: bold;
    }
    .style16
    {
    height: 10px;
    text-align: center;
    width: 64px;
    }
    .style17
    {
    height: 10px;
    width: 64px;
    }
    .style18
    {
    width: 64px;
    }
    .style19
    {
    height: 10px;
    text-align: center;
    color: #33CCFF;
    font-weight: bold;
    }
    .style20
    {
    color: #000000;
    background-color: #33CCFF;
    }
    .style21
    {
    height: 10px;
    width: 246px;
    font-weight: bold;
    }
    .style22
    {
    text-align: center;
    font-weight: bold;
    font-size: xx-large;
    color: #6699FF;
    background-color: #00FF00;
    }
    .style23
    {
    background-color: #00FF00;
    }
    .style24
    {
    height: 10px;
    width: 33px;
    }
    .style25
    {
    width: 33px;
    }
    .style26
    {
    color: #0066FF;
    font-weight: bold;
    }
    .nouveauStyle1
    {
    position: absolute;
    left: 2%;
    }
    .nouveauStyle2
    {
    position: absolute;
    left: 10%;
    }
    .nouveauStyle3
    {
    position: absolute;
    left: 16%;
    }
    .nouveauStyle12
    {
    position: absolute;
    left: 85%;
    }
    </style>
    </head>
    <body>
    <form id="form1" runat="server">
    <div style="width: 731px; height: 272px">

    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" onload="UpdatePanel1_Load">
    <ContentTemplate>
    <p class="style22"><span class="style23">HORAIRES TYPE SUR UNE SEMAINE</span></p>
    <table class="style1" title="blablabla">
    <tr>
    <td bgcolor="#66CCFF" class="style21">
    Jours de consultation</td>
    <td bgcolor="#33CCFF" class="style15" colspan="4">
    Horaire 1</td>
    <td class="style16">
    &nbsp;</td>
    <td bgcolor="#33CCFF" class="style19" colspan="4">
    <span class="style20">Horaire 2</span></td>
    </tr>
    <tr>
    <td class="style6">
    <asp:CheckBox ID="CheckLundi" runat="server" AutoPostBack="True"
    oncheckedchanged="CheckBox1_CheckedChanged" Text="Lundi" TextAlign="Left" />
    </td>
    <td class="style8">
    &nbsp;De&nbsp;</td>
    <td class="style10">
    <asp:TextBox ID="Lundi_Horaire1_HeureDebut" runat="server" Enabled="False"
    Width="69px"></asp:TextBox>
    </td>
    <td class="style12">
    &nbsp;à&nbsp;</td>
    <td class="style24">
    <asp:TextBox ID="Lundi_Horaire1_HeureFin" runat="server" Width="69px"></asp:TextBox>
    </td>
    <td class="style17">
    &nbsp;</td>
    <td class="style4">
    &nbsp;De&nbsp;</td>
    <td class="style4">
    <asp:TextBox ID="Lundi_Horaire2_HeureDebut" runat="server" Width="69px"></asp:TextBox>
    </td>
    <td class="style4">
    &nbsp;à&nbsp;</td>
    <td class="style4">
    <asp:TextBox ID="Lundi_Horaire2_HeureFin" runat="server" Width="69px"></asp:TextBox>
    </td>
    </tr>
    <tr>
    <td class="style7">
    <asp:CheckBox ID="CheckMardi" runat="server" AutoPostBack="True"
    oncheckedchanged="CheckMardi_CheckedChanged" Text="Mardi" TextAlign="Left" />
    </td>
    <td class="style9">
    &nbsp;De&nbsp;</td>
    <td class="style11">
    <asp:TextBox ID="Mardi_Horaire1_HeureDebut" runat="server" Enabled="False"
    Width="69px"></asp:TextBox>
    </td>
    <td class="style13">
    &nbsp;à&nbsp;</td>
    <td class="style25">
    <asp:TextBox ID="Mardi_Horaire1_HeureFin" runat="server" Width="69px"></asp:TextBox>
    </td>
    <td class="style18">
    &nbsp;</td>
    <td class="style14">
    &nbsp;De&nbsp;</td>
    <td class="style14">
    <asp:TextBox ID="Mardi_Horaire2_HeureDebut" runat="server" Width="69px"></asp:TextBox>
    </td>
    <td class="style14">
    &nbsp;à&nbsp;</td>
    <td class="style14">
    <asp:TextBox ID="Mardi_Horaire2_HeureFin" runat="server" Width="69px"></asp:TextBox>
    </td>
    </tr>
    <tr>
    <td class="style7">
    <asp:CheckBox ID="CheckMercredi" runat="server"
    oncheckedchanged="CheckMercredi_CheckedChanged" Text="Mercredi"
    TextAlign="Left" />
    </td>
    <td class="style9">
    &nbsp;De&nbsp;</td>
    <td class="style11">
    <asp:TextBox ID="Mercredi_Horaire1_HeureDebut" runat="server" Width="69px"></asp:TextBox>
    </td>
    <td class="style13">
    &nbsp;à&nbsp;</td>
    <td class="style25">
    <asp:TextBox ID="Mercredi_Horaire1_HeureFin" runat="server" Width="69px"></asp:TextBox>
    </td>
    <td class="style18">
    &nbsp;</td>
    <td class="style14">
    &nbsp;De&nbsp;</td>
    <td class="style14">
    <asp:TextBox ID="Mercredi_Horaire2_HeureDebut" runat="server" Width="69px"></asp:TextBox>
    </td>
    <td class="style14">
    &nbsp;à&nbsp;</td>
    <td class="style14">
    <asp:TextBox ID="Mercredi_Horaire2_HeureFin" runat="server" Width="69px"></asp:TextBox>
    </td>
    </tr>
    <tr>
    <td class="style7">
    <asp:CheckBox ID="CheckJeudi" runat="server"
    oncheckedchanged="CheckJeudi_CheckedChanged" Text="Jeudi" TextAlign="Left" />
    </td>
    <td class="style9">
    &nbsp;De&nbsp;</td>
    <td class="style11">
    <asp:TextBox ID="Jeudi_Horaire1_HeureDebut" runat="server" Width="69px"></asp:TextBox>
    </td>
    <td class="style13">
    &nbsp;à&nbsp;</td>
    <td class="style25">
    <asp:TextBox ID="Jeudi_Horaire1_HeureFin" runat="server" Width="69px"></asp:TextBox>
    </td>
    <td class="style18">
    &nbsp;</td>
    <td class="style14">
    &nbsp;De&nbsp;</td>
    <td class="style14">
    <asp:TextBox ID="Jeudi_Horaire2_HeureDebut" runat="server" Width="69px"></asp:TextBox>
    </td>
    <td class="style14">
    &nbsp;à&nbsp;</td>
    <td class="style14">
    <asp:TextBox ID="Jeudi_Horaire2_HeureFin" runat="server" Width="69px"></asp:TextBox>
    </td>
    </tr>
    <tr>
    <td class="style7">
    <asp:CheckBox ID="CheckVendredi" runat="server"
    oncheckedchanged="CheckVendredi_CheckedChanged" Text="Vendredi"
    TextAlign="Left" />
    </td>
    <td class="style9">
    &nbsp;De&nbsp;</td>
    <td class="style11">
    <asp:TextBox ID="Vendredi_Horaire1_HeureDebut" runat="server" Width="69px"></asp:TextBox>
    </td>
    <td class="style13">
    &nbsp;à&nbsp;</td>
    <td class="style25">
    <asp:TextBox ID="Vendredi_Horaire1_HeureFin" runat="server" Width="69px"></asp:TextBox>
    </td>
    <td class="style18">
    &nbsp;</td>
    <td class="style14">
    &nbsp;De&nbsp;</td>
    <td class="style14">
    <asp:TextBox ID="Vendredi_Horaire2_HeureDebut" runat="server" Width="69px"></asp:TextBox>
    </td>
    <td class="style14">
    &nbsp;à&nbsp;</td>
    <td class="style14">
    <asp:TextBox ID="Vendredi_Horaire2_HeureFin" runat="server" Width="69px"></asp:TextBox>
    </td>
    </tr>
    <tr>
    <td class="style7">
    <asp:CheckBox ID="CheckSamedi" runat="server"
    oncheckedchanged="CheckSamedi_CheckedChanged" Text="Samedi"
    TextAlign="Left" />
    </td>
    <td class="style9">
    &nbsp;De&nbsp;</td>
    <td class="style11">
    <asp:TextBox ID="Samedi_Horaire1_HeureDebut" runat="server" Width="69px"></asp:TextBox>
    </td>
    <td class="style13">
    &nbsp;à&nbsp;</td>
    <td class="style25">
    <asp:TextBox ID="Samedi_Horaire1_HeureFin" runat="server" Width="69px"></asp:TextBox>
    </td>
    <td class="style18">
    &nbsp;</td>
    <td class="style14">
    &nbsp;De&nbsp;</td>
    <td class="style14">
    <asp:TextBox ID="Samedi_Horaire2_HeureDebut" runat="server" Width="69px"></asp:TextBox>
    </td>
    <td class="style14">
    &nbsp;à&nbsp;</td>
    <td class="style14">
    <asp:TextBox ID="Samedi_Horaire2_HeureFin" runat="server" Width="69px"></asp:TextBox>
    </td>
    </tr>
    </table>
    </ContentTemplate>
    </asp:UpdatePanel>

    </div>
    <p>&nbsp;</p>
    <p class="style26">Choix des périodes</p>

    <asp:UpdatePanel ID="UpdatePanel2" runat="server" onload="UpdatePanel1_Load">
    <ContentTemplate>
    <p class="style26">
    <asp:Button ID="Bn01" runat="server" onclick="Bn01_Click"
    Text="Janvier" />
    <asp:Button ID="Bn02" runat="server" onclick="Bn01_Click"
    Text="Février" />
    <asp:Button ID="Bn03" runat="server" onclick="Bn01_Click" Text="Mars" />
    <asp:Button ID="Bn04" runat="server" onclick="Bn01_Click" Text="Avril" />
    <asp:Button ID="Bn05" runat="server" onclick="Bn01_Click" Text="Mai" />
    <asp:Button ID="Bn06" runat="server" onclick="Bn01_Click" Text="Juin" />
    <asp:Button ID="Bn07" runat="server" onclick="Bn01_Click"
    Text="Juillet" />
    <asp:Button ID="Bn08" runat="server" onclick="Bn01_Click" Text="Août" />
    <asp:Button ID="Bn09" runat="server" onclick="Bn01_Click"
    Text="Septembre" />
    <asp:Button ID="Bn10" runat="server" onclick="Bn01_Click"
    Text="Octobre" />
    <asp:Button ID="Bn11" runat="server" onclick="Bn01_Click"
    Text="Novembre" />
    <asp:Button ID="Bn12" runat="server" onclick="Bn01_Click"
    Text="Decembre" />
    </p>
    <aspanel ID="Panel1" runat="server" BackColor="Lime" Height="125px"
    Width="340px" CssClass="nouveauStyle1">
    <asp:CheckBoxList ID="CheckBoxList1" runat="server" Height="97px" Width="336px">
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    </asp:CheckBoxList>
    </aspanel>
    <aspanel ID="Panel2" runat="server" BackColor="Yellow" Height="125px"
    Width="340px" Visible="False" CssClass="nouveauStyle2">
    <asp:CheckBoxList ID="CheckBoxList2" runat="server"
    Height="97px" Width="336px">
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    </asp:CheckBoxList>
    </aspanel>
    <aspanel ID="Panel3" runat="server" BackColor="Blue" Height="125px"
    Width="340px" Visible="False" CssClass="nouveauStyle3">
    <asp:CheckBoxList ID="CheckBoxList3" runat="server"
    Height="97px" Width="336px"
    onselectedindexchanged="CheckBoxList3_SelectedIndexChanged">
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    </asp:CheckBoxList>
    </aspanel>
    <aspanel ID="Panel4" runat="server" BackColor="Lime" Height="125px"
    Width="340px" Visible="False">
    <asp:CheckBoxList ID="CheckBoxList4" runat="server" Height="97px" Width="336px">
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    </asp:CheckBoxList>
    </aspanel>
    <aspanel ID="Panel5" runat="server" BackColor="Yellow" Height="125px"
    Width="340px" Visible="False">
    <asp:CheckBoxList ID="CheckBoxList5" runat="server"
    Height="97px" Width="336px">
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    </asp:CheckBoxList>
    </aspanel>
    <aspanel ID="Panel6" runat="server" BackColor="Blue" Height="125px"
    Width="340px" Visible="False">
    <asp:CheckBoxList ID="CheckBoxList6" runat="server"
    Height="97px" Width="336px">
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    </asp:CheckBoxList>
    </aspanel>
    <aspanel ID="Panel7" runat="server" BackColor="Lime" Height="125px"
    Width="340px" Visible="False">
    <asp:CheckBoxList ID="CheckBoxList7" runat="server" Height="97px" Width="336px">
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    </asp:CheckBoxList>
    </aspanel>
    <aspanel ID="Panel8" runat="server" BackColor="Yellow" Height="125px"
    Width="340px" Visible="False">
    <asp:CheckBoxList ID="CheckBoxList8" runat="server"
    Height="97px" Width="336px">
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    </asp:CheckBoxList>
    </aspanel>
    <aspanel ID="Panel9" runat="server" BackColor="Blue" Height="125px"
    Width="340px" Visible="False">
    <asp:CheckBoxList ID="CheckBoxList9" runat="server"
    Height="97px" Width="336px">
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    </asp:CheckBoxList>
    </aspanel>
    <aspanel ID="Panel10" runat="server" BackColor="Lime" Height="125px"
    Width="340px" Visible="False">
    <asp:CheckBoxList ID="CheckBoxList10" runat="server" Height="97px" Width="336px">
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    </asp:CheckBoxList>
    </aspanel>
    <aspanel ID="Panel11" runat="server" BackColor="Yellow" Height="125px"
    Width="340px" Visible="False">
    <asp:CheckBoxList ID="CheckBoxList11" runat="server"
    Height="97px" Width="336px">
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    </asp:CheckBoxList>
    </aspanel>
    <aspanel ID="Panel12" runat="server" BackColor="Blue" Height="125px"
    Width="340px" Visible="False" CssClass="nouveauStyle12">
    <asp:CheckBoxList ID="CheckBoxList12" runat="server"
    Height="97px" Width="336px">
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    <asp:ListItem></asp:ListItem>
    </asp:CheckBoxList>
    </aspanel>
    </ContentTemplate>
    </asp:UpdatePanel>
    <p>
    <asp:ListBox ID="ListBox1" runat="server" Font-Bold="True" Height="100px"
    SelectionMode="Multiple" Width="340px">
    <asp:ListItem>Semaine 1 : Lundi 1/1/2009 au Samedi 6/1/209</asp:ListItem>
    <asp:ListItem>Semaine 2 : Lundi 8/1/2009 au Samedi 13/1/209</asp:ListItem>
    <asp:ListItem>Semaine 3 : Lundi 15/1/2009 au Samedi 20/1/209</asp:ListItem>
    <asp:ListItem>Semaine 4 : Lundi 22/1/2009 au Samedi 27/1/209</asp:ListItem>
    <asp:ListItem>Semaine 5 : Lundi 29/1/2009 au Samedi 3/2/209</asp:ListItem>
    <asp:ListItem></asp:ListItem>
    </asp:ListBox>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <asp:Button ID="Button1" runat="server" Text="Valider"
    onclick="Button1_Click" />
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <asp:Button ID="Button2" runat="server" Text="Raz champs" />
    </p>
    </form>
    </body>
    </html>


    fichier GestionAgenda.cs :

    using System;
    using System.Windows.Forms;
    using System.Collections;
    using System.Configuration;
    using System.Data;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;

    public partial class GestionAgenda : System.Web.UI.Page
    {
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
    {
    Lundi_Horaire1_HeureDebut.Enabled = CheckLundi.Checked;
    Lundi_Horaire1_HeureFin.Enabled = CheckLundi.Checked;
    Lundi_Horaire2_HeureDebut.Enabled = CheckLundi.Checked;
    Lundi_Horaire2_HeureFin.Enabled = CheckLundi.Checked;
    }
    protected void CheckMardi_CheckedChanged(object sender, EventArgs e)
    {
    Mardi_Horaire1_HeureDebut.Enabled = CheckMardi.Checked;
    Mardi_Horaire1_HeureFin.Enabled = CheckMardi.Checked;
    Mardi_Horaire2_HeureDebut.Enabled = CheckMardi.Checked;
    Mardi_Horaire2_HeureFin.Enabled = CheckMardi.Checked;
    }
    protected void CheckMercredi_CheckedChanged(object sender, EventArgs e)
    {
    Mercredi_Horaire1_HeureDebut.Enabled = CheckMercredi.Checked;
    Mercredi_Horaire1_HeureFin.Enabled = CheckMercredi.Checked;
    Mercredi_Horaire2_HeureDebut.Enabled = CheckMercredi.Checked;
    Mercredi_Horaire2_HeureFin.Enabled = CheckMercredi.Checked;

    }
    protected void CheckJeudi_CheckedChanged(object sender, EventArgs e)
    {
    Jeudi_Horaire1_HeureDebut.Enabled = CheckJeudi.Checked;
    Jeudi_Horaire1_HeureFin.Enabled = CheckJeudi.Checked;
    Jeudi_Horaire2_HeureDebut.Enabled = CheckJeudi.Checked;
    Jeudi_Horaire2_HeureFin.Enabled = CheckJeudi.Checked;
    }
    protected void CheckVendredi_CheckedChanged(object sender, EventArgs e)
    {
    Vendredi_Horaire1_HeureDebut.Enabled = CheckVendredi.Checked;
    Vendredi_Horaire1_HeureFin.Enabled = CheckVendredi.Checked;
    Vendredi_Horaire2_HeureDebut.Enabled = CheckVendredi.Checked;
    Vendredi_Horaire2_HeureFin.Enabled = CheckVendredi.Checked;
    }
    protected void CheckSamedi_CheckedChanged(object sender, EventArgs e)
    {
    Samedi_Horaire1_HeureDebut.Enabled = CheckSamedi.Checked;
    Samedi_Horaire1_HeureFin.Enabled = CheckSamedi.Checked;
    Samedi_Horaire2_HeureDebut.Enabled = CheckSamedi.Checked;
    Samedi_Horaire2_HeureFin.Enabled = CheckSamedi.Checked;
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
    ConnectionStringSettings settings;
    settings = System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionCabinetMedical"];
    string connectionString = settings.ConnectionString;
    //string strRequete = "INSERT INTO AGENDA_PRATICIENS (NumeroID_PRATICIEN,"
    // +"DATE_CONSULTATION, MATIN_HEURE_DEBUT, MATIN_HEURE_FIN, "
    // +"APRESMIDI_HEURE_DEBUT, APRESMIDI_HEURE_FIN)"
    // +"VALUES ('"+Request.Cookies["NumeroID"].Value+"',"
    // +UneDate.ToString()+","
    // +"'"+Lundi_Horaire1_HeureDebut.Text+"',"
    // +"'"+Lundi_Horaire1_HeureFin.Text + "',"
    // + "'" + Lundi_Horaire2_HeureDebut.Text + "',"
    // + "'" + Lundi_Horaire2_HeureFin.Text + "')";

    //try
    //{
    //SqlConnection oConnection = new SqlConnection(connectionString);

    //SqlCommand oCommand = new SqlCommand(strRequete, oConnection);
    //oConnection.Open();
    //Label1.Text = "Etat de la connexion : " + oConnection.State;
    //SqlDataReader oReader = oCommand.ExecuteReader();
    //if (oReader.HasRows)
    //{
    //oReader.Read();
    //Label1.Text = Label1.Text + " (" + oReader.GetString(0) + "-" + oReader.GetString(1) + "-" + oReader.GetInt32(2).ToString() + "-" + oReader.GetString(3) + ")";
    //**** le type de connection : P = Praticien, M=Patient et A=Administrateur général
    //TypeAcces = oReader.GetString(3);
    //NumeroID = oReader.GetInt32(2);
    //Label1.Text = Label1.Text + "-" + TypeAcces;
    //if (Login1.UserName == oReader.GetString(0) & Login1.Password == oReader.GetString(1))
    //e.Authenticated = true;
    //}
    //oConnection.Close();
    //}
    //catch (Exception erreur)
    //{
    // Label1.Text = "L'erreur suivante a été rencontrée :" + erreur.Message;
    //}


    for (int i=0; i < ListBox1.Items.Count; i++)
    {
    if (ListBox1.Items[i].Selected == true)
    {
    MessageBox.Show(ListBox1.Items[i].ToString());
    }
    }

    //foreach (string s in ListBox1.SelectedItem)
    //{
    // MessageBox.Show(s);
    //}
    }
    int SemaineDuneDate(DateTime dt)
    {
    DateTime dtWeek = new DateTime(dt.Year, 1, 1);
    System.TimeSpan ts = dt.Subtract(dtWeek);
    int day = ts.Days;

    return day / 7 + 1;
    }

    protected void UpdatePanel1_Load(object sender, EventArgs e)
    {
    if (!Page.IsPostBack) //Pour ne l'execute qu'une fois
    {
    DateTime DateDebut = DateTime.Parse("01/01/2009");
    DateTime DateFin = DateTime.Parse("31/12/2009");
    DateTime UneDate;
    int NbrJours = DateFin.Subtract(DateDebut).Days;


    MessageBox.Show(NbrJours.ToString());
    for (int i = 0; i <= NbrJours; i++)
    {
    UneDate = DateDebut.AddDays(i);
    //ListBox1.Items.Add(UneDate.ToString());
    ListBox1.Items.Add("Semaine "+SemaineDuneDate(UneDate).ToString()+" : "+UneDate.ToString());
    }
    }
    }
    protected void Bn01_Click(object sender, EventArgs e)
    {
    Panel1.Visible = false;
    Panel2.Visible = false;
    Panel3.Visible = false;
    Panel4.Visible = false;
    Panel5.Visible = false;
    Panel6.Visible = false;
    Panel7.Visible = false;
    Panel8.Visible = false;
    Panel9.Visible = false;
    Panel10.Visible = false;
    Panel11.Visible = false;
    Panel12.Visible = false;

    string chaine_numbtn = ((System.Web.UI.WebControls.Button)sender).ID.Substring(2, 2);
    int numbtn = Convert.ToInt32(chaine_numbtn);
    System.Web.UI.WebControls.Panel LePanel = (System.Web.UI.WebControls.Panel)FindControl("Panel" + numbtn.ToString());
    LePanel.Visible = true;
    }
    }

  4. #4
    Rédacteur
    Avatar de lutecefalco
    Profil pro
    zadzdzddzdzd
    Inscrit en
    Juillet 2005
    Messages
    5 052
    Détails du profil
    Informations personnelles :
    Âge : 45
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : zadzdzddzdzd

    Informations forums :
    Inscription : Juillet 2005
    Messages : 5 052
    Par défaut
    T'aurais pu virer les trucs inutiles

  5. #5
    Membre confirmé
    Profil pro
    Inscrit en
    Mai 2002
    Messages
    131
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2002
    Messages : 131
    Par défaut
    je m'excuse mais je pensais qu'envoyer une partie du code te serait insuffisant et j'ai donc tout envoyé pour mieux comprendre le contexte

    désolé

  6. #6
    Rédacteur
    Avatar de lutecefalco
    Profil pro
    zadzdzddzdzd
    Inscrit en
    Juillet 2005
    Messages
    5 052
    Détails du profil
    Informations personnelles :
    Âge : 45
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : zadzdzddzdzd

    Informations forums :
    Inscription : Juillet 2005
    Messages : 5 052
    Par défaut
    T'es sûr que c'est la fénêtre que se rafraichit?
    Pas plutot tes 2 update panels?

Discussions similaires

  1. framework AJAX pour Asp.Net
    Par ASPAK dans le forum ASP.NET
    Réponses: 11
    Dernier message: 17/04/2008, 14h40
  2. Installer des extensions AJAX pour ASP.NET
    Par Rick62 dans le forum ASP.NET
    Réponses: 3
    Dernier message: 21/02/2008, 17h48
  3. [AJAX] Ajax et ASP.NET
    Par boleduch dans le forum Général JavaScript
    Réponses: 2
    Dernier message: 02/03/2006, 16h15

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo