Form post back in ASP.Net 1.1

G

Guest

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
 
S

Steve C. Orr [MVP, MCSD]

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.
 
G

Guest

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
 
G

Guest

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.
 
T

TDAVISJR

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.
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top