Good afternoon.
I would like you to help me, I'm doing a modal that runs as long as it registers and an error message appears.
So far what I have achieved if you register but the modal message is not displayed.
I'm doing my insertion with sql server and asp c # the error message is one of my output variables from my procedure.
the code "+ message +": it is an output variable that in my procedure tells me if the registration is correct or the registration or duplicate data was not processed. the record already exists
This is the code of my code-behind:
cmd.Parameters["@idregistrotarea"].Value = lblidregistrotareas.Text;
cmd.Parameters["@usuario"].Value = lblatendidopor.Text;
cmd.Parameters["@fechaemision"].Value = lblfechareg.Text;
cmd.Parameters["@fechacumplimiento"].Value = TxtFechaPago.Text;
cmd.Parameters["@fechaatendido"].Value = TxtFecha.Text;
cmd.Parameters["@montopagado"].Value = TxtMontoPagado.Text;
cmd.Parameters["@numerorecibo"].Value = txtNumeroRecibo.Text;
cmd.Parameters["@tarea"].Value = dprTarea.Text;
cmd.Parameters["@oficina"].Value = dprAgencia.SelectedValue;
cmd.Parameters["@fechaemisions"].Value = txtFechaEmision.Text;
cmd.Parameters["@comentario"].Value = txtComentario.Text;
cmd.Parameters["@fechacumplimientotarea"].Value = txtfechaoculta.Text;
cmd.Parameters["@ERROR"].Direction = ParameterDirection.Output;
cn.Open();
BtnnoConforme.Enabled = false;
cmd.ExecuteNonQuery();
message = (string)cmd.Parameters["@ERROR"].Value;
ScriptManager.RegisterStartupScript(this, GetType(), "Show Modal Popup", message, true);
cn.Close();
TxtMontoPagado.Text = "";
txtNumeroRecibo.Text = "";
TxtFecha.Text = "";
}
}
This is the code of my HTML.
<script type="text/javascript">
function showmodalpopup1() {
$("#popupdiv").dialog({
width: 400,
height: 150,
autoOpen: true,
draggable: false,
resizable: false,
hide: "slide",
modal: true,
});
};
</script>
div id="popupdiv" title="Basic modal dialog" style="display: none;">