Asp.net Session Bilgisini Silme (Session.RemoveAll)

Bir önceki uygulamamızda Session.RemoveAt komutu ile istediğimiz bir session bilgisini silmiştik şimdi ise tüm session bilgilerini silmek için Session.RemoveAll komutunu kullanacağız.
sessiontumunusil

<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
    protected void Page_Load(object sender, System.EventArgs e) {
        Session["sifre"] = "12345";
        Session["kadi"] = "ahmet";
        Session["kmail"] = "ahmet@mailadresi.com";
        Label1.Text = "Session hazılandı...<br />";
        Label1.Text += "Sifreniz : " + Session["sifre"];
        Label1.Text += "<br />Kullanıcı Adınız : " + Session["kadi"];
        Label1.Text += "<br />Mail Adresiniz : " + Session["kmail"];
        Label1.Text += "<br> Şimdi Kulanıcı Şifrenizi Silelim";

        Session.RemoveAll();
        Label1.Text += "<br /><br />Şifreniz : " + Session["sifre"];
        Label1.Text += "<br />Kullanıcı Adı : " + Session["kadi"];
        Label1.Text += "<br />Mail Adresiniz : " + Session["kmail"];
    }
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>asp.net session RemoveAll örnekleri:www.aspnetornekleri.com</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <h2 style="color:Green">asp.net session örnekleri: Session RemoveAll</h2>
        <asp:Label 
            ID="Label1" 
            runat="server" 
            Font-Size="Large"
            ForeColor="IndianRed"
            >
        </asp:Label>
    </div>
    </form>
</body>
</html>

You may also like...

Subscribe
Bildir
guest
0 Yorum
Inline Feedbacks
View all comments
0
Yazı hakkındaki yorum, görüş ve önerilerinizi yazınx
()
x