Gilnet 0 Denunciar post Postado Julho 27, 2010 Olá; Tenho este método dentro de uma página e porém dá o seguinte erro: App_Form_Cadastro_CadAssociado.Login(string)': nem todos os caminhos de código retornam um valor. public bool Login(string Titulo) { Path = Request.PhysicalApplicationPath + "\\app_Data\\Login.db"; if (!File.Exists(Path)) { Response.Redirect("~/App_Form/MSG/MSG.aspx?idMSG=" + "1"); } else { StreamReader SR; string S = string.Empty; SR = File.OpenText(Path); while (!Permissao) { S = SR.ReadLine(); Linha = Convert.ToString(S); if (Linha.ToUpper() == (lblTitulo.Text.ToUpper())) { return true; } else { return false; } SR.Close(); } Alguém ajuda ???? Obrigado. Compartilhar este post Link para o post Compartilhar em outros sites
quintelab 91 Denunciar post Postado Julho 28, 2010 Dentro do seu if: if (!File.Exists(Path)) { Response.Redirect("~/App_Form/MSG/MSG.aspx?idMSG=" + "1"); } Tem um redirect, você deve retornar um valor E não dar um redirect. Abraços... Compartilhar este post Link para o post Compartilhar em outros sites
Gilnet 0 Denunciar post Postado Julho 28, 2010 OK Resolvido. Obrigado. Compartilhar este post Link para o post Compartilhar em outros sites