Mensagem não aparece na tela mais. Antes funcionava
Pessoal, estava tudo ok, o mesmo código abaixo e agora ele não funciona mais. Grava inclusive no BD, mas a mensagem de gravado com sucesso, limpeza dos campos e chamar a página anterior não funciona mais. O erro é o abaixo e abaixo o meu código dentro de um try.
[System.Threading.ThreadAbortException] = {Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.}
Meu código:
if (!pesquisa.ExisteTriagem(edtNumDoc.Text))
{
dados.insereTriagem(int.Parse(Session["CodUsuario"].ToString()), int.Parse(cbxTipoDoc.SelectedValue), edtNumDoc.Text, int.Parse(cbxRamo.SelectedValue),
rblObrigacao.SelectedValue, edtNomeAutor.Text, edtCpfAutor.Text, edtObs.Text, dataCadastro, rblTarefa.SelectedValue,
dataPrazo, edtNmArea.Text, outroDoc);
ClientScript.RegisterClientScriptBlock(this.GetType(), "MensagemDeAlert", "alert('" + mensagem + "');", true);
limpaCampos();
Response.Redirect("../Pesquisa/frmPsqTriagem.aspx");
}
else
{
ClientScript.RegisterClientScriptBlock(this.GetType(), "MensagemDeAlert", "alert('" + triagem_realizado + "');", true);
edtNumDoc.Focus();
}
}
catch (Exception ex)
{
ClientScript.RegisterClientScriptBlock(this.GetType(), "MensagemDeAlert", "alert('" + ex.Message + "');", true);
}
finally
{
}
[System.Threading.ThreadAbortException] = {Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.}
Meu código:
if (!pesquisa.ExisteTriagem(edtNumDoc.Text))
{
dados.insereTriagem(int.Parse(Session["CodUsuario"].ToString()), int.Parse(cbxTipoDoc.SelectedValue), edtNumDoc.Text, int.Parse(cbxRamo.SelectedValue),
rblObrigacao.SelectedValue, edtNomeAutor.Text, edtCpfAutor.Text, edtObs.Text, dataCadastro, rblTarefa.SelectedValue,
dataPrazo, edtNmArea.Text, outroDoc);
ClientScript.RegisterClientScriptBlock(this.GetType(), "MensagemDeAlert", "alert('" + mensagem + "');", true);
limpaCampos();
Response.Redirect("../Pesquisa/frmPsqTriagem.aspx");
}
else
{
ClientScript.RegisterClientScriptBlock(this.GetType(), "MensagemDeAlert", "alert('" + triagem_realizado + "');", true);
edtNumDoc.Focus();
}
}
catch (Exception ex)
{
ClientScript.RegisterClientScriptBlock(this.GetType(), "MensagemDeAlert", "alert('" + ex.Message + "');", true);
}
finally
{
}
Pjava
Curtidas 0
Respostas
Pjava
18/04/2013
Fiz a chamada ao form assim:
Response.Redirect("../Formularios/frmPsqTriagem.aspx", false)
Coloquei um false. O erro abaixo não aparece mais, mas continua não exibindo a mensagem em javascript.
[System.Threading.ThreadAbortException] = {Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.}
Que mais tenho que fazer?
Response.Redirect("../Formularios/frmPsqTriagem.aspx", false)
Coloquei um false. O erro abaixo não aparece mais, mas continua não exibindo a mensagem em javascript.
[System.Threading.ThreadAbortException] = {Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.}
Que mais tenho que fazer?
GOSTEI 0
Joel Rodrigues
18/04/2013
Tenta depurar isso pra ver se descobre o local da falha, tanto pelo Visual Studio quanto pelo debugger do browser.
GOSTEI 0
Pjava
18/04/2013
Pelo debuger do browser, não sei fazer e gostaria de aprender.
GOSTEI 0
Joel Rodrigues
18/04/2013
Existe o Firebug pra Firefox, mas eu nunca usei. No Chrome, basta pressionar F12 e na parte inferior aparecerá uma guia com algumas ferramentas. Na aba Console você pode ver erros de JavaScript que estejam ocorrendo.
GOSTEI 0
Pjava
18/04/2013
Vou fazer isso. Achei legal e não sabia disso que era possível. Penso que posso debugar qualquer coisa em minha página, desde que esteja no aspx eu debugo, js, jquery, se chama ou não css e etc...
GOSTEI 0
Pjava
18/04/2013
Resolvido.
GOSTEI 0
Pjava
18/04/2013
GOSTEI 0
Joel Rodrigues
18/04/2013
Obrigado pelo feedback.
Estou concluindo este tópico.
Estou concluindo este tópico.
GOSTEI 0