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

Posted on 2007-04-05
Last Modified: 2008-03-17

I do this all the time in ASP webpages

     action = Request("action")

What is the equivalent in ASPX webpages ?


--- Mike

Question by:MikeCombe
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
LVL 37

Expert Comment

ID: 18860890
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"

Author Comment

ID: 18860913
sorry......I'm trying to READ Name/Value pairs using ASPX.
How to I do that ?

-- Mike
LVL 37

Accepted Solution

samtran0331 earned 250 total points
ID: 18861095
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 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")
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

LVL 37

Expert Comment

ID: 18861104
there are some things to keep in mind when using server.transfer though...
LVL 10

Assisted Solution

jinn_hnnl earned 250 total points
ID: 18861487
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


Author Comment

ID: 18861666'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 ?


LVL 10

Expert Comment

ID: 18861674
You can use:

string fruit = Request.QueryString("Fruit");

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below.…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question