cintiadel 0 Denunciar post Postado Janeiro 28, 2011 Tenho uma aplicação onde existe uma busca após o login do cliente. Quando o login expira, e ele tenta buscar novamente da essa mensagem: "failed to load viewstate. The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request. For example, when adding controls dynamically, the controls added during a post-back must match the type and position of the controls added during the initial request" Estou usando viewstate para passar os parametros e essas viewstates são passadas no load da página. Em qual evento eu deveria tratar isso para que de uma mensagem dizendo que o login expirou e voltar para página default? Grata Compartilhar este post Link para o post Compartilhar em outros sites
Daniel LM Costa 2 Denunciar post Postado Janeiro 28, 2011 faz a verificação do objeto com a função IsNothing...Se ele estiver nothing você achou a origem do erro.. Depois a coisa muda de figura que é como convervar esse cara na memória, que é um caminho que pode passar pela utilização de cookies Compartilhar este post Link para o post Compartilhar em outros sites
cintiadel 0 Denunciar post Postado Janeiro 31, 2011 faz a verificação do objeto com a função IsNothing...Se ele estiver nothing você achou a origem do erro.. Depois a coisa muda de figura que é como convervar esse cara na memória, que é um caminho que pode passar pela utilização de cookies Ela esta sendo feita dessa forma: If Not Me.Page.IsPostBack Then If Not Request.Params("teste1") Is Nothing Then ViewState("teste1") = Int32.Parse(Request.Params("teste1")) Else ViewState("teste1") = 0 End If If Not Request.Params("teste2") Is Nothing Then ViewState("teste2") = Request.Params("teste2") ViewState("teste3") = Request.Params("teste3") Else Dim oUser As SqlClient.SqlDataReader = CSUsuario.IdUsuario(Page.User.Identity.Name) If oUser.Read Then If Not oUser.IsDBNull(oUser.GetOrdinal("teste2")) Then ViewState("teste2") = oUser.GetInt32(oUser.GetOrdinal("teste2")) ViewState("teste3") = oUser.GetInt32(oUser.GetOrdinal("teste3")) End If Else ViewState("teste2") = 0 ViewState("teste3") = 0 End If End If gridBind() End If Compartilhar este post Link para o post Compartilhar em outros sites