What is the equivalent of ASP action = Request("action") --> in ASPX webpages ?


I do this all the time in ASP webpages

     action = Request("action")

What is the equivalent in ASPX webpages ?


--- Mike

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ASP.Net by default always posts to itself, so the action of a form will always be what you would see in the address bar and the method by default is always: method="post"
MikeCombeAuthor Commented:
sorry......I'm trying to READ Name/Value pairs using ASPX.
How to I do that ?

-- Mike
how you read variables from one page to another will depend on how the variables got to the second page from the first...

if on page1 you have a asp.net textbox with ID="textbox1" and then to get to page 2, you do:


then on page2, request still works:
dim str as string = request("textbox1")

session and querystring work pretty much like in old asp...
Session("something") = "Hi"
Dim str as string = "33"
response.redirect("page2.aspx?Myvar=" & str)

dim str1 as string = session("something")
dim str2 as string = request.querystring("Myvar")

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Become a Microsoft Certified Solutions Expert

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

there are some things to keep in mind when using server.transfer though...
May be in C# (just convert samtran0331 idea):

You can use QueryString to pass data through pages.

Session("something") = "Hello";
string value = textbox1.Text;
Response.Redirect("page2.aspx?Name=" + value);

// aspx page .. then question mark ?  : page.aspx -> ? -> NAME= -> VALUE if you wanna add more pair NAME/VALUE .. just add &.
//like:  Response.Redirect("page2.aspx?Name1=value1&Name2=value2&Name3=value3);

string message = session("something");
string value = Request.QueryString("Name");

Just in case you need C# code

MikeCombeAuthor Commented:
sorry.....it's not that complicated....

given:    myWebpage.aspx?Fruit=Apple
how do I get the name value pair ?....
In ASP I would use...
                Fruit = Request("Fruit")
How do I do that with ASPX ?


You can use:

string fruit = Request.QueryString("Fruit");
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.