Get parameters passed by url on another page

5

I have this call to another page, passing 2 parameters.

Response.Redirect("/frmPVFichaCadastral.aspx?CdProcesso=" + vhdfCdProcesso.Value + "&CdTipoUsuario=" + vhdfCdTipoUsuario.Value)

How do I get these parameters passed here on this page /frmPVFichaCadastral.aspx ?

    
asked by anonymous 20.11.2014 / 19:24

2 answers

5

Using Request.QueryString :

string CdProcesso = Request.QueryString["CdProcesso"];
string CdTipoUsuario = Request["CdTipoUsuario"];

The first line demonstrates capturing the value directly via the QueryString collection. The second is that the value can also be obtained via indexed property of object Request - as long as the name is unique between the Form collection and the QueryString collection.     

20.11.2014 / 19:28
1

Use:

string CdProcesso1 = Request.QueryString["CdProcesso"];
string CdProcesso2 = Request["CdProcesso"];
    
20.11.2014 / 19:32