By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,589 Members | 1,194 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,589 IT Pros & Developers. It's quick & easy.

Error while using html controls

P: n/a
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
Nov 16 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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.

--
in**@dowhileloop.com
http://dowhileloop.com
http://publicjoe.dowhileloop.com -- .NET Tutorials
"sushi" <su***@discussions.microsoft.com> wrote in message
news:80**********************************@microsof t.com...
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

Nov 16 '05 #2

P: n/a
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

"sushi" wrote:
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

Nov 16 '05 #3

P: n/a
Tell you the truth I don't think that Response.Redirect is JavaScript.
That's .NET.
Make them .NET controls then it will be a lot easer to catch events instead
of trying to do HTML controls.

--
in**@dowhileloop.com
http://dowhileloop.com website development
http://publicjoe.dowhileloop.com -- C# Tutorials

"sushi" <su***@discussions.microsoft.com> wrote in message
news:15**********************************@microsof t.com...
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

"sushi" wrote:
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

Nov 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.