Groups | Blog | Home
all groups > asp.net > april 2005 >

asp.net : Form post back in ASP.Net 1.1



Sundararajan
4/24/2005 11:39:04 PM
Dear Folks,

I have a hyperlink in my page - webform1.aspx
on click of this i want it to post back to the second page -webform2.aspx.
is this possible in ASP.Net 1.1. if so how can i go about it.
I tried to use a javascript function for this

function dopostback()
{

document.Form1.hdnpostback.value="hhhhh";
document.Form1.method = "Post";
document.Form1.action="webform2.aspx";
document.Form1.submit();
}

but it was not working.

thanx in advance
--
Snig
4/25/2005 12:00:24 AM
Steve C. Orr [MVP, MCSD]
4/25/2005 12:09:50 AM
Here are some options:
1) Output an old fashioned non-server form to the client (without the runat=
'server' attribute) Set the action attribute like you would have in
ASP.OLD, and use javascript to submit the form.
2) use client side script to change your ASP.NET form action attribute
3) use this webform control: http://www.wilsondotnet.com/Controls/

Note: In ASP.NET 2.0 you will be able to more easily post to another page.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net


[quoted text, click to view]

Kannan.V [MCSD.net]
4/25/2005 12:16:02 AM
hi sundar,

Are you trying to navigate to the second page on click of the hyperlink
button?
if yes just use the server.transfer or the response.redirect on the click
event of the hyperlink button.

regds
Kannan.V

[quoted text, click to view]
Deepti Kalakonda
4/25/2005 2:19:01 AM
As Kannan has rightly mentioned, if u want navigate to the second page, you
can use server.transfer or Response.Redirect. But, if you want to persist and
use the values of the controls that are on the first Web page, you can use
Server.Transfer. In the Server.Transfer method, you have the PreserveForm
parameter. If you set this parameter to true, you can save the values of the
controls on the first Web page as name value pairs in a collection.



[quoted text, click to view]
Kannan.V [MCSD.net]
4/25/2005 4:27:10 AM
hi sundar,

please do not post the same question in multiple forums, if u want to post
pls cross post you queries, just a request, so that its easy for people to
track the responses.

It happened to me that i was searching for the reply i wrote, and finally
found it in another group.

regds
Kannan.V


[quoted text, click to view]
TDAVISJR
4/25/2005 6:31:01 AM
Remember to use a Link Button instead of a regular HTML <a href.. The link
button default behavior is a postback and you can capture the click event
and then do your server re-direction in there.

--
TDAVISJR
aka - Tampa.NET Koder


[quoted text, click to view]

AddThis Social Bookmark Button