bluejoao Posted March 7, 2009 at 11:37 AM Report Share #248884 Posted March 7, 2009 at 11:37 AM Tou a criar uma classe para por uma password num botão e criei este codigo, mas no response da-,e um "erro" (name response is not declared).. não percebo o que tenho que fazer para retirar o erro... help? 😉 Public Class Class_login Public Function Login(ByVal TextBox1 As TextBox, ByVal TextBox2 As TextBox) If TextBox1.Text = "admin" And TextBox2.Text = "admin" Then Response.Redirect("admin.aspx") Else Response.Redirect("erro.aspx") End If End Function End Class Link to comment Share on other sites More sharing options...
vitortomaz Posted March 7, 2009 at 12:20 PM Report Share #248896 Posted March 7, 2009 at 12:20 PM já n mexo em asp à algum bastante tempo mas podes aceder directamente ao Response em VB? tenta Context.Response.Redirect http://vitortomaz.blogspot.com/ Link to comment Share on other sites More sharing options...
Hellblazer Posted March 8, 2009 at 09:06 AM Report Share #249062 Posted March 8, 2009 at 09:06 AM Peço desculpa nao reparei que tinha sido movido pois nao tinha informaçao no topico la atraz. No entanto fica aqui a solução para nao estar-mos a dividir a ajuda em dois topicos 😄 Em vez de Response.Redirect exprimenta Server.Transfer There are two ways to write error-free programs; only the third one works. Link to comment Share on other sites More sharing options...
ruby Posted April 22, 2009 at 09:28 AM Report Share #258166 Posted April 22, 2009 at 09:28 AM Eu penso que não podes aceder numa classe directamente a opções Web. Toda a navegação deverá ser feita nas classes que tenham : Inherits System.Web.UI.Page São as páginas geradas pelo asp.Net. Penso que o código colocado aqui será de Uma Code File (class) e sendo assim penso que arranjarás alguma solução de a Classe comunicar com as páginas *.aspx.vb de modo a que possas fazer ou o Response.redirect ou o Server.Transfer. Cumps. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now