Click here to Skip to main content
15,891,529 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Documents in SQL Server database Pin
Not Active27-May-11 10:11
mentorNot Active27-May-11 10:11 
GeneralRe: Documents in SQL Server database Pin
Aptiva Dave27-May-11 10:29
Aptiva Dave27-May-11 10:29 
GeneralRe: Documents in SQL Server database Pin
Not Active27-May-11 12:08
mentorNot Active27-May-11 12:08 
GeneralRe: Documents in SQL Server database Pin
Aptiva Dave31-May-11 8:51
Aptiva Dave31-May-11 8:51 
QuestionProtect XML from outside access in asp.net Pin
Prasanta_Prince26-May-11 21:04
Prasanta_Prince26-May-11 21:04 
AnswerRe: Protect XML from outside access in asp.net Pin
AspDotNetDev26-May-11 21:47
protectorAspDotNetDev26-May-11 21:47 
GeneralRe: Protect XML from outside access in asp.net Pin
Prasanta_Prince26-May-11 22:59
Prasanta_Prince26-May-11 22:59 
QuestionSafe logout in asp.net Pin
Ranjani krishnamurthy26-May-11 18:06
Ranjani krishnamurthy26-May-11 18:06 
Hi All,
I developed a login page and added a link button(for logout) in all other pages. The code that I used behind logout is just Response.Redirect("Login.aspx")
So, when I click logout, it redirects me to the Login page but when I click back button in the browser, it goes into the application without the need of login. Frown | :-(
Can anyone please help me how to do a safe logout in a web appliction so that even when I click back button it should not be entered into the application again without a proper login?
i've neither used a session variable nor FormsAuthentication. If I have to use session variables, please explain me how to use them(as I'm new to .NET). The code that I used in the login page is below:

Imports System.Data.SqlClient<br />
<br />
Partial Class Login<br />
    Inherits System.Web.UI.Page<br />
Protected Sub Login1_Authenticate(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.AuthenticateEventArgs) Handles Login1.Authenticate<br />
        Dim authentication As Boolean = False<br />
        authentication = Sitelevelauthentication(Login1.UserName, Login1.Password)<br />
        e.Authenticated = authentication<br />
        If authentication = True Then<br />
            Response.Redirect("Default.aspx")<br />
        End If<br />
<br />
    End Sub<br />
    Private Function Sitelevelauthentication(ByVal Username As String, ByVal Password As String) As Boolean<br />
        Dim boolretval As Boolean<br />
        Dim con As New SqlConnection<br />
        Dim Dr As SqlDataReader<br />
        Dim sql As String<br />
        con.ConnectionString = "Data Source=;Initial Catalog=;User ID=;Password="<br />
        sql = "SELECT * FROM Login"<br />
        con.Open()<br />
        Dim cmd As New SqlCommand(sql, con)<br />
        Dr = cmd.ExecuteReader()<br />
        While Dr.Read()<br />
            If Username = Dr("Username").ToString And Password = Dr("Password") Then<br />
                boolretval = True<br />
            End If<br />
            Dr.Close()<br />
            Return boolretval<br />
<br />
        End While<br />
    End Function<br />
End Class


Thank you,
Ranjani.
AnswerRe: Safe logout in asp.net Pin
Blue_Boy26-May-11 21:19
Blue_Boy26-May-11 21:19 
AnswerRe: Safe logout in asp.net Pin
Monjurul Habib27-May-11 9:04
professionalMonjurul Habib27-May-11 9:04 
QuestionSetting Environment Variables Pin
indian14326-May-11 13:01
indian14326-May-11 13:01 
AnswerRe: Setting Environment Variables Pin
R. Giskard Reventlov26-May-11 23:09
R. Giskard Reventlov26-May-11 23:09 
GeneralRe: Setting Environment Variables Pin
indian14327-May-11 5:52
indian14327-May-11 5:52 
QuestionFilter RSS Feeds by Keywords Using LINQ to XML Pin
Dominick Marciano26-May-11 12:48
professionalDominick Marciano26-May-11 12:48 
QuestionHow to call back to a VBS file or EXE from the Menu control? [modified] Pin
Jun Du26-May-11 5:36
Jun Du26-May-11 5:36 
AnswerRe: How to call back to a VBS file or EXE from the Menu control? Pin
Dalek Dave1-Jun-11 22:29
professionalDalek Dave1-Jun-11 22:29 
Questionauthenticate particular page in a directory to particular user or role Pin
Asif Rehman26-May-11 3:30
Asif Rehman26-May-11 3:30 
AnswerRe: authenticate particular page in a directory to particular user or role Pin
Orcun Iyigun26-May-11 6:45
Orcun Iyigun26-May-11 6:45 
QuestionEventValidation between v1.1 and 2.0 Pin
bryanforst26-May-11 0:39
bryanforst26-May-11 0:39 
AnswerRe: EventValidation between v1.1 and 2.0 Pin
Orcun Iyigun26-May-11 7:11
Orcun Iyigun26-May-11 7:11 
QuestionCan i ristrict a perticular page to not to resize in a website. Pin
saxenaabhi625-May-11 14:37
saxenaabhi625-May-11 14:37 
AnswerRe: Can i ristrict a perticular page to not to resize in a website. Pin
Not Active25-May-11 15:38
mentorNot Active25-May-11 15:38 
GeneralRe: Can i ristrict a perticular page to not to resize in a website. Pin
saxenaabhi625-May-11 15:46
saxenaabhi625-May-11 15:46 
QuestionHow do I get a hidden input value to refer to a text box? Pin
Dave Clark QED25-May-11 12:05
Dave Clark QED25-May-11 12:05 
AnswerRe: How do I get a hidden input value to refer to a text box? Pin
Not Active25-May-11 15:36
mentorNot Active25-May-11 15:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.