Error while using html controls

G

Guest

Hello,
I am developing an asp.net website. In this I am using a web form say'
Web form1.aspx' which has two button controls say 'button1' and 'button2'.
When I am click 'button1' it displays a text 'Hi'. When I click the other
button 'button2', it redirects to different page say' Webform2.aspx'.
Now if I click the 'Back' menu of the browser, I again get
'webform1.aspx'. Now if I click on 'button1' again then instead of displaying
text 'Hi' it redirects to Webform2.aspx'.
Does any one know why this is happening?
I am using java scripts document.webform1.submit( ) method for posting data
back to the server.

Thanks,
Sushi
 
L

Landi

are these ASP.NET buttons or HTML buttons?
possible to post some code? It would be hard to give you a solution without
knowing what is going on in your code.
 
G

Guest

Hello,

I am using HTML controls. When a user clicks on button1, following java
script code is executed

button1_click( )
{
document.webform1.submit( );
}

On the page load event
txt.Text = "Hi";
is executed

When a user clicks on button2, following code is executed on the server

button2_ServerClick( )
{
Response.Redirect( "webform2.aspx" );
}

Now if I click on button1 first time, I get "hi" message. Then is I click on
'button2, webform2.aspx is displayed. but Now if I click the 'Back' menu of
the browser, I again get 'webform1.aspx'. Now if I click on 'button1' again
then instead of displaying text 'Hi' it redirects to Webform2.aspx'.

Sushi
 

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

Top