ASP.NET Response.Redirect does not work

0

My problem is this:

I have a POS in which I need to send the following parameters by url:

  • amount
  • transaction reference (it is generated automatically according to the consecutive ticket)
  • customer mail

Once the seller clicks the Pay button, the following happens:

string ticketNum = genTicketNumber();
    if(ticketNum != "")
        Response.Redirect(Constantes.Paginas.Carrito + "?" + montoPago+ "=" + referenciaVta+"="+txtemail.Text);

But when I click on it, in the URL I do not see that it has changed and still shows the url original

  

link

The problem is that, before I did, however since I distributed the entire cart in a Multiview control, the re-address with the "?" and it only works if I use a diagonal "/" that is:

It works

  

link

It does not work

  

link

EDIT the re-address I use to be able to tell my android app when I need to send to the activity where the charge is made. Here I leave the webView code where that was valid.

@Override
        public void onPageFinished(WebView view, String url) {
            //Toast.makeText(getApplicationContext(),"Carga Finalizada",Toast.LENGTH_LONG).show();
            if(pd.isShowing())
                pd.dismiss();
            if(url.contains("sendScanReader"))
            {
                Intent i = new Intent(getApplicationContext(),Scan.class);
                //pd.dismiss();
                startActivityForResult(i,100);

            }else if(url.contains("vta")){
                StringTokenizer tokens = new StringTokenizer(url,"/");
                String first = tokens.nextToken();
                String second = tokens.nextToken();

                StringTokenizer tokenValues = new StringTokenizer(second,"=");
                //total a pagar durante la transaccion
                String ttlPago = tokenValues.nextToken();
                // referencia
                String reference = tokenValues.nextToken();
                reference = reference.replace("_","/");
                // email
                String email = tokenValues.nextToken();

                Intent i = new Intent(getApplicationContext(),Payment.class);
                i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                i.putExtra("ttlPago",ttlPago);
                i.putExtra("vtaRef",reference);
                i.putExtra("correo",email);
                //view.loadUrl(Common.getHomeURL());
                //pd.dismiss();
                startActivityForResult(i,100);
            }
            else{
                if(pd.isShowing())
                    pd.dismiss();
                Common.setURL(url);
            }
            if(pd.isShowing())
                pd.dismiss();
            super.onPageFinished(view, url);
            if(pd.isShowing())
                pd.dismiss();
        }
    
asked by Rodrigo Jimenez 18.01.2018 в 19:40
source

2 answers

1

It happens that when you use the "/" it is as if you were sending to another page and you are going to access without any more, what I see and I suspect is your problem is that you are not assigning any variable where to store the parameters that you want to send . Test this way.

Response.Redirect(Constantes.Paginas.Carrito + "?montoPago=" + montoPago+ "&referenciaVta=" + referenciaVta + "&email=" + txtemail.Text.ToString());

Already at the time of consuming your parameters you do it like this:

Request.QueryString["montoPago"].ToString();
    
answered by 18.01.2018 в 20:41
0

You mention that you use the URL

http://localhost:48789/[email protected]

Are not the assignments upside down? I think the URL does not have the correct format

http://localhost:48789/CarritoDetalle.aspx?idTicket=1600&[email protected]
    
answered by 19.01.2018 в 19:38