Solved

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

Posted on 2007-04-05
7
394 Views
Last Modified: 2008-03-17
Greetings,

I do this all the time in ASP webpages

     action = Request("action")

What is the equivalent in ASPX webpages ?

Thanks,

--- Mike



0
Comment
Question by:MikeCombe
  • 3
  • 2
  • 2
7 Comments
 
LVL 37

Expert Comment

by:samtran0331
ID: 18860890
Mike,
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"
0
 

Author Comment

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

-- Mike
0
 
LVL 37

Accepted Solution

by:
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 asp.net textbox with ID="textbox1" and then to get to page 2, you do:

server.transfer("page2.aspx",true)


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



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

page2:
dim str1 as string = session("something")
dim str2 as string = request.querystring("Myvar")
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 37

Expert Comment

by:samtran0331
ID: 18861104
there are some things to keep in mind when using server.transfer though...
http://www.developer.com/net/asp/article.php/3299641
0
 
LVL 10

Assisted Solution

by:jinn_hnnl
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.

Page1:
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);

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

Just in case you need C# code


0
 

Author Comment

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

Thanks

0
 
LVL 10

Expert Comment

by:jinn_hnnl
ID: 18861674
You can use:

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

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

813 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now