473,322 Members | 1,718 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

posting to another aspx page

Hi!

This is my problem:

I want to go from page1 to page2,
and to get all the form variables from page1
to page2.

I have turned the viewstate and the sessionstate off,
and i really just want to get these variables the
oldfashioned way (ie via the request.form collection)

This is how im trying to do this:
I have a javascript that fires on page1 that
changes the action of its form to page2 and then submits
the page.
//page1 javascript
function test()
{
Form1.target="_blank";
Form1.action="page2.aspx";
Form1.submit();
}
but when i get to page2, the form collection
from page1 is gone...
+ the request object says i used method=GET...

can someone help me out here plz

Nov 17 '05 #1
5 4303
If you are using standard html controls in that form, you can remove the
runat=server attribute to treat it as an old-fashioned, "classic" form. Then
set the action attribute to your new form.

--
James J. Foster, DotNetCoders
http://www.dotnetcoders.com

"Magnus" <ho*******@hotmail.com> wrote in message
news:0b****************************@phx.gbl...
Hi!

This is my problem:

I want to go from page1 to page2,
and to get all the form variables from page1
to page2.

I have turned the viewstate and the sessionstate off,
and i really just want to get these variables the
oldfashioned way (ie via the request.form collection)

This is how im trying to do this:
I have a javascript that fires on page1 that
changes the action of its form to page2 and then submits
the page.
//page1 javascript
function test()
{
Form1.target="_blank";
Form1.action="page2.aspx";
Form1.submit();
}
but when i get to page2, the form collection
from page1 is gone...
+ the request object says i used method=GET...

can someone help me out here plz

Nov 17 '05 #2
Make sure your form tag has method=post in it.

Also, for future reference, in page1, you could always use
Server.Transfer( "page2.aspx").

hth,
Dave
www.aspNetEmail.com

"Magnus" <ho*******@hotmail.com> wrote in message
news:0b****************************@phx.gbl...
Hi!

This is my problem:

I want to go from page1 to page2,
and to get all the form variables from page1
to page2.

I have turned the viewstate and the sessionstate off,
and i really just want to get these variables the
oldfashioned way (ie via the request.form collection)

This is how im trying to do this:
I have a javascript that fires on page1 that
changes the action of its form to page2 and then submits
the page.
//page1 javascript
function test()
{
Form1.target="_blank";
Form1.action="page2.aspx";
Form1.submit();
}
but when i get to page2, the form collection
from page1 is gone...
+ the request object says i used method=GET...

can someone help me out here plz

Nov 17 '05 #3
There are a couple of ways to do this. For a form post, switch the form in
question back to a standard HTML form and then pull from the request
collection. It is also possible to transfer on the server and use viewstate
to pull data (and better in a truly .NET enable environ).

In your example, you would be best to either make the paradigm shift to .NET
(ie, form and handler in same page (can be done rather easily with
containers like panels)) or switch the form to a client side standard HTML
form and pull from request.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
Author: ADO.NET and XML: ASP.NET on the Edge

************************************************** **************************
****
Think Outside the Box!
************************************************** **************************
****
"Magnus" <ho*******@hotmail.com> wrote in message
news:0b****************************@phx.gbl...
Hi!

This is my problem:

I want to go from page1 to page2,
and to get all the form variables from page1
to page2.

I have turned the viewstate and the sessionstate off,
and i really just want to get these variables the
oldfashioned way (ie via the request.form collection)

This is how im trying to do this:
I have a javascript that fires on page1 that
changes the action of its form to page2 and then submits
the page.
//page1 javascript
function test()
{
Form1.target="_blank";
Form1.action="page2.aspx";
Form1.submit();
}
but when i get to page2, the form collection
from page1 is gone...
+ the request object says i used method=GET...

can someone help me out here plz

Nov 17 '05 #4
thanx, but, my problem is more complex than that.
check this out:
page1
|_| -> A couple of buttons, that do the ordinary
postback .net stuf

->but for one button I want the user to stay on the
current page +send the form information to a separate page
in another browser window.

ie its not just a question of processing the data in
another webform, but keep the old form alive,
and get another one started.

Page2 is an excel presentation of the data in page1,
and i want the user to be able to look att both
at the same time.

the first way (standard HTML form)
sounds like a lot of hassle as I have a table
that i build dynamically, containing a couple of
servercontrols
It might be possible, but surely
there must be a simpler way to make page2 treat the request
as a post request and not drop the form variables?
-----Original Message-----
There are a couple of ways to do this. For a form post, switch the form inquestion back to a standard HTML form and then pull from the requestcollection. It is also possible to transfer on the server and use viewstateto pull data (and better in a truly .NET enable environ).

In your example, you would be best to either make the paradigm shift to .NET(ie, form and handler in same page (can be done rather easily withcontainers like panels)) or switch the form to a client side standard HTMLform and pull from request.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
Author: ADO.NET and XML: ASP.NET on the Edge

************************************************* ********* **********************
Think Outside the Box!
************************************************* ********* **********************
"Magnus" <ho*******@hotmail.com> wrote in message
news:0b****************************@phx.gbl...
Hi!

This is my problem:

I want to go from page1 to page2,
and to get all the form variables from page1
to page2.

I have turned the viewstate and the sessionstate off,
and i really just want to get these variables the
oldfashioned way (ie via the request.form collection)

This is how im trying to do this:
I have a javascript that fires on page1 that
changes the action of its form to page2 and then submits
the page.
//page1 javascript
function test()
{
Form1.target="_blank";
Form1.action="page2.aspx";
Form1.submit();
}
but when i get to page2, the form collection
from page1 is gone...
+ the request object says i used method=GET...

can someone help me out here plz

.

Nov 17 '05 #5
Hi,

Use the Form target attribute :

<form target="_blank" id="WebForm2" action="WebForm3.aspx"
method="post">
<INPUT name = "a" style="Z-INDEX: 101; LEFT: 121px; WIDTH: 182px;
POSITION: absolute; TOP: 83px; HEIGHT: 31px" type="text" size="25">
<INPUT name = "b" style="Z-INDEX: 102; LEFT: 126px; WIDTH: 171px;
POSITION: absolute; TOP: 135px; HEIGHT: 33px" type="text" size="23">
<INPUT style="Z-INDEX: 103; LEFT: 166px; WIDTH: 88px; POSITION:
absolute; TOP: 216px; HEIGHT: 38px" type="submit" value="Submit">
</form>

Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114

Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377

Know the overall picture
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: HANG LAM | last post by:
Hi, Simple question, Is there a way to post the data from one .aspx page to another page ? For example, I have a Page1.aspx that lets the user enter data like "Last Name", "First Name", but...
6
by: anon | last post by:
Post Forwarding question...... For this control below, <asp:Button runat="server" PostTargetUrl="page2.aspx" /> The Attribute: PostTargetUrl="page2.aspx" Is this PostTargetUrl Attribute...
10
by: DaveFash | last post by:
Posting variables from an HTML FORM, via the Request.Form function on the receiving ASP page is great. But how can you POST a Form variable to an ASP page -- without a human pushing a Submit...
9
by: buran | last post by:
Dear ASP.NET Programmers, How can I post data to an ASP.NET login page and pass authentication? The login page uses forms authentication, users must supply usernames and password and have to...
3
by: Raja Balaji R | last post by:
hi I have a page1.aspx which accepts Username, Password which is posted to page2.aspx using a submit button, i want page2.aspx to submit, transfer or redirect the same posted information which...
2
by: Rob Shorney | last post by:
Hi, We currently have a classic asp web application. We are currently looking at upgrading this to ASP.NET. However I have a couple of problems that need to be resolved. 1. aspx forms...
6
by: Andrew | last post by:
Hello, friends, I tried to do cross-page posting, i.e., in firstpage.aspx I used action="secondpage.aspx". Since I am using asp.net 1.1, so it always goes back to firstpage.aspx aftern...
2
by: Peter2 | last post by:
Hi, I have a problem posting non-ASCII characters in FORM fields between classic ASP and ASP.NET. I use a fully patched Windows 2000 Advanced Server with .net 2.0 and visual Studio 2005 installed,...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.