Grab parameters passed by url on another page

Asked

Viewed 7,885 times

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?

  • vhdfCdProcess, serious?

2 answers

5


Utlizing Request.Querystring:

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

The first line demonstrates the capture of the value directly via Querystring collection. The second, that the value can also be obtained via Indexed Property of the Object Request - as long as the name is unique among the collection Form and the collection QueryString.

1

Use:

string CdProcesso1 = Request.QueryString["CdProcesso"];
string CdProcesso2 = Request["CdProcesso"];

Browser other questions tagged

You are not signed in. Login or sign up in order to post.