Barre horizontale de naviagtion

lundi 31 janvier 2011

asp.net validationGroupe

aspx Code










c# code

Page.Validate("Profil");
if (Page.IsValid)
{
//Traitement
}

Popup sur Master Page

code aspx popup:












code c#

#region Profils
private void ClearProfil()
{
TBox_OldPasse.Text = "";
TBox_ConfirmPass.Text = "";
TBox_NewPass.Text = "";
}
private void SaveProfil()
{
Page.Validate("Profil");
if (Page.IsValid)
{
SessionData.CurrentUser.Password = TBox_NewPass.Text.Trim();
ClsLogicUtilisateurs.UpdateUtilisateurs(SessionData.CurrentUser);
mdlProfilPoup.Hide();
}
else
mdlProfilPoup.Show();

}
private void SendPassword()
{
ClsPassword_Demande objPasswordDemande = new ClsPassword_Demande();
objPasswordDemande.Login = SessionData.CurrentUser.NomLogin;
objPasswordDemande.Nom = SessionData.CurrentUser.Nom;
objPasswordDemande.Prenom = SessionData.CurrentUser.Prenom;
objPasswordDemande.Date = DateTime.Now;
ClsLogicPassword_Demande.InsertPassword_Demande(objPasswordDemande);

mdlProfilPoup.Hide();
}
protected void Btn_registerProfil_Click(object sender, EventArgs e)
{
SaveProfil();
}
protected void cv_OldPassword_ServerValidate(object source, ServerValidateEventArgs args)
{
args.IsValid = ClsLogicUtilisateurs.GetUtilisateurByID(SessionData.CurrentUser.ID_Utilisateur).Password.Trim().Equals(TBox_OldPasse.Text.Trim());

}
protected void btn_send_pass_Click(object sender, EventArgs e)
{
SendPassword();
}
protected void btnClose_Click(object sender, EventArgs e)
{
mdlProfilPoup.Hide();
}
protected void lblConnectedUser_Click(object sender, EventArgs e)
{
ClearProfil();
mdlProfilPoup.Show();

}
#endregion

mercredi 19 janvier 2011

autocompleteExtender ajaxToolkit

WebService Code :AutoComplete.cs
le code à mettre dans le dossier app_code

using System;
using System.Collections.Generic;
using System.Web.Services;
using DataLayer;

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]

[System.Web.Script.Services.ScriptService]
public class AutoComplete : WebService
{
public AutoComplete()
{
}

[WebMethod]
public string[] GetCompletionList(string prefixText, int count)
{
List lstPublication =ClsLogicPublication.SelectAllEquipementPublication();
List PublicationArray = new List();
List list = lstPublication .FindAll(
delegate(ClsPublication pub)
{
return pub.IdPublication.ToString().ToLower().StartsWith(prefixText);
});
foreach(ClsPublication publ in list)
{
string item = AjaxControlToolkit.AutoCompleteExtender.CreateAutoCompleteItem(publ.IdPublication.ToString(), publ.DesignationPublication_FR.ToString());
PublicationArray.Add(item);
}
return PublicationArray.ToArray();

}
}


le code asmx du webservice :AutoComplete.asmx


<%@ WebService
Language="C#"
CodeBehind="~/App_Code/AutoComplete.cs"
Class="AutoComplete" %>


le code Aspx de la page :AutoComplete.aspx

















<%-- Collapse down to 0px and fade out --%>









le code css du panel autocomplete

.autocomplete_completionListElement
{
margin : 0px!important;
background-color : inherit;
color : windowtext;
border : buttonshadow;
border-width : 1px; border-style : solid;
cursor : 'default'; overflow : auto; height : 200px; text-align : left; list-style-type : none;
padding:0px;
}
/* AutoComplete highlighted item */
.autocomplete_highlightedListItem { background-color: #ffff99; color: black; padding: 1px; }

/* AutoComplete item */

.autocomplete_listItem { background-color : window; color : windowtext; padding : 1px; }



pour plus de détails voir ce lien
http://www.highoncoding.com/Articles/595_Implementing_Auto_Suggest_Using_AutoComplete

lundi 10 janvier 2011

Partage Dossier windows 7

aller à :
Control Panel-->Network and Sharing Center-->change Advanced sharing settings

Control Panel/All Control Panel Items/Network and Sharing Center/
sélectionner Home or work
aller 'password protected sharing ' est déactiver là

puis suivre ces étapes pour partager dossier :