We have an ASPX application that behaves oddly when rendering the page for the first time.
To put you in context:
MyWeb -> MyPaymentWebAplication.
We send our client to the payment site and we are suposed to get back to the Web an OK from the payment site.
MyPaymentWebAplication -> MyWeb.
Here is where the problem occurs.
We have a special page in our Web: GetResponseFromPaymentPage.aspx, This page, is only used to get the OK response from the payment so in theory, it always have to be rendered for the first time and by this, join (!IsPostBack).
The problem here is that the page in not joining here and instead jumps out and nothing executes so we dont get any confirmation.
Code here:
try
{
HtmlForm frm = (HtmlForm)FindControl("frmRedireccion");
NameValueCollection parametros = (NameValueCollection)Session[ConstantesSesion.SESSION_PARAMETERS_RETURNED];
frm.Action = parametros["AppReturnURL"];
foreach (string key in parametros.Keys)
{
if (((HtmlInputHidden)frm.FindControl(key)) != null)
{
((HtmlInputHidden)frm.FindControl(key)).Value = parametros[key];
}
}
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append("<script language=Javascript>\n");
sb.Append(" window.opener.name = 'MyParent'; ");
sb.Append(" document.forms.namedItem('frmRedireccion').target = 'MyParent'; ");
sb.Append(" document.forms.namedItem('frmRedireccion').submit(); ");
sb.Append(" self.window.close(); ");
sb.Append("</script>");
ClientScript.RegisterStartupScript(this.GetType(), "script", sb.ToString());
}
catch (Exception ex)
{
ExceptionService.SetException("Excepción en el método " + MethodBase.GetCurrentMethod().Name, ex);
}
Back to the Web, we should recive the parameters and start doing our things on the recently opened page.
protected void Page_Load(object sender, EventArgs e)
{
//We are writing these traces on DB!
MyTraces con = new MyTraces();
con.InsertTrace("Im a Trace!", "!We are in!", System.DateTime.Today, "1");
//************************************************************
if (!Page.IsPostBack)
{
// These ones are not behing seen anywhere in DB
con.InsertTrace("Im a Trace!", "!We are in step 2 Already!", System.DateTime.Today,"2");
So, we supose that !Page.IsPostBack is not returning True, when it should be and by this, our second trace is not getting writen in DB.
¿Does anyone Know What could be causing this issue? We are thinking on any patch, update, or something else on our systems because we have no other explanations, this app has been running for a while whitout problems.