Protected Sub btnLogon_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim connstring As New SqlConnection("Server=kabunyawan\sqlexpress;Database=ojt;Trusted_Connection=True;")
Dim rs1 As New SqlDataAdapter("select * from wall where uname = '" & txtuname.Text & "' and pword = '" & txtpword.Text & "'", connstring)
Dim ds As New DataSet
Dim tmpStr As String
rs1.Fill(ds, "wall")
Try
tmpStr = ds.Tables("wall").Rows(0).Item("lvl")
If tmpStr = "admin" Then
Response.Redirect("contact.aspx")
Else
Response.Write(tmpStr)
Response.Write("admin")
Response.Write("1111111111111111")
End If
Catch ex As Exception
Response.Cookies("errmsg").Value = "Invalid username/password. Please contact the admins for assisstance."
Response.Redirect("merror.aspx")
End Try
End Sub
i am having error on response.redirect("contact.aspx").. but my other webforms are working..Problem Solved.. that error was caused by the "try-catch" part.. I've read that response.redirect will always give out an error if placed within a try-catch.. now i know!
Now read that Response.Write is a bad thing on ASP.NET pages. :)
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment