473,394 Members | 1,737 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,394 software developers and data experts.

Error while using html controls

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
3 1987
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
5
by: ddd | last post by:
Hi, I am having problems with using the DrawToDC of the MSHTML.iHTMLElementRender in a VB.net application. For some reason I am getting a "catastrophic error". I am basing the code on c#...
10
by: RodBillett | last post by:
Using SmartNavigation. Windows2003 Server Framework 1.0 (3705) IIS6 and I have IIS configured to utilize the 1.0 framework. Any Ideas why I would be getting the following jscript error within...
0
by: Roman | last post by:
I'm trying to create the form which would allow data entry to the Client table, as well as modification and deletion of existing data rows. For some reason the DataGrid part of functionality stops...
11
by: Wolfgang Kaml | last post by:
I am not sure if this is more of an expert question, but I am sure that they are out there. I'd like to setup a general application or bin directory on my Win2003.Net Server that will hold some...
1
by: Joe | last post by:
I have created a web application using C#. I have done several web based apps in C# and have not had this problem before. I think this may be a defect in the VisualSutdio.net2003. I am using a...
4
by: rushikesh.joshi | last post by:
Hi All, I have created my own WebControl and want to add it in my aspx page at runtime. it's compiling perfectly, but when i m going to execute, it gives me error of "Object reference not set...
0
by: pabloazorin | last post by:
I developed a Date Picker web control using C# and .net framework 1.1 I added my control to Visual Studio 2003 IDE toolbar. When I drag and drop my control to design web page, the control renders...
7
nathj
by: nathj | last post by:
Hi, I'm new to ASP, I normally develop in PHP but this little project requires me to use ASP. Being a newbie in this I've run into some difficulty. I'm modifying code from a third party....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.