URL Params

G

Guest

Hi:

Me question is the next:

I would like know how, I can do it to pass params, from a control of a page
ASPX to other page ASPX, but I don't want that this params can see in the
URL, besides I want use this params in the page, how I can do it to request
this params...??

I am using C# like languaje...

Thanks....!!!
 
S

Stefano

Hi,

you can make a POST.

ASP.NET 2.0 will fill this needs out-of-the-box.

In ASP.net 1.x this is not very simple. You need a workaround to do that.

You can play with JavaScript (that could be rendered from the server as
RegisterStartupScript), changing the "action" property of the <form>
rendered with the webform, to point it to your second aspx file, and then
call submit method.

<input type="hidden" id="yourhiddenfield" name="yourhiddenfield" />
<script language="javascript">
document.forms[0].action = "yourotherpage.aspx";
document.all["yourhiddenfield"].value = "foo";
document.forms[0].submit();
</script>

In yourotherpage.aspx:
....
string myvalue = Request["yourhiddenfield"];

HTH

Bye

Stefano
 
J

Joerg Jooss

Stefano said:
Hi,

you can make a POST.

You can also make your life hell. With POST, all requests become not
repeatable (-> browser warning on back button) and (in theory) non
cacheable. If that's what is desired -- fine. Otherwise forget about
using POST as the normal way to move from page to page *unless* you are
really submitting a form.

Cheers,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top