473,394 Members | 1,759 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.

LinkButton click, refresh the page

I have a webpage that has a link button. This link button on click
opens up a new page.
This is what is happening:

1. Load the web page.
2. Click on the link.
3. Refresh the web-page.
Result: The webpage gets refreshed and the link buttons onClick event
is fired.

However, if I just load the web-page and without clicking on the link
button, refresh the web-page it does not fire the onClick event of the
link button.

I don't want the link button's onClick event to fire when I refresh the
web-page. How can we prevent this from happening?

Thanks and Regards,
Sameer

Nov 19 '05 #1
3 9988
By clicking the link you are posting back the page. Once you've posted back
the page and the user hits refresh or F5 you're asking the browser to do
whatever it did last (which is a post). To fix this, have your LinkButton's
OnClick do a Response.Redirect(Request.Path).

-Brock
DevelopMentor
http://staff.develop.com/ballen
I have a webpage that has a link button. This link button on click
opens up a new page.
This is what is happening:
1. Load the web page.
2. Click on the link.
3. Refresh the web-page.
Result: The webpage gets refreshed and the link buttons onClick event
is fired.
However, if I just load the web-page and without clicking on the link
button, refresh the web-page it does not fire the onClick event of the
link button.

I don't want the link button's onClick event to fire when I refresh
the web-page. How can we prevent this from happening?

Thanks and Regards,
Sameer


Nov 19 '05 #2
The link button's onClick event does a window.open (Javascript) and
writes it to the response object. If I do a Response.Redirect, the
window.open action is lost.

Seems like I need some other way of doing the window.open and not using
the Response.Write to write the window.open javascript to it. Not
really sure how to do it...

Thanks,
Sameer
Brock Allen wrote:
By clicking the link you are posting back the page. Once you've posted back
the page and the user hits refresh or F5 you're asking the browser to do
whatever it did last (which is a post). To fix this, have your LinkButton's
OnClick do a Response.Redirect(Request.Path).

-Brock
DevelopMentor
http://staff.develop.com/ballen
I have a webpage that has a link button. This link button on click
opens up a new page.
This is what is happening:
1. Load the web page.
2. Click on the link.
3. Refresh the web-page.
Result: The webpage gets refreshed and the link buttons onClick event
is fired.
However, if I just load the web-page and without clicking on the link
button, refresh the web-page it does not fire the onClick event of the
link button.

I don't want the link button's onClick event to fire when I refresh
the web-page. How can we prevent this from happening?

Thanks and Regards,
Sameer


Nov 19 '05 #3
Just changed the link button to hyperlink and it works fine now.

Thanks,
Sameer

Sameer wrote:
The link button's onClick event does a window.open (Javascript) and
writes it to the response object. If I do a Response.Redirect, the
window.open action is lost.

Seems like I need some other way of doing the window.open and not using
the Response.Write to write the window.open javascript to it. Not
really sure how to do it...

Thanks,
Sameer
Brock Allen wrote:
By clicking the link you are posting back the page. Once you've posted back
the page and the user hits refresh or F5 you're asking the browser to do
whatever it did last (which is a post). To fix this, have your LinkButton's
OnClick do a Response.Redirect(Request.Path).

-Brock
DevelopMentor
http://staff.develop.com/ballen
I have a webpage that has a link button. This link button on click
opens up a new page.
This is what is happening:
1. Load the web page.
2. Click on the link.
3. Refresh the web-page.
Result: The webpage gets refreshed and the link buttons onClick event
is fired.
However, if I just load the web-page and without clicking on the link
button, refresh the web-page it does not fire the onClick event of the
link button.

I don't want the link button's onClick event to fire when I refresh
the web-page. How can we prevent this from happening?

Thanks and Regards,
Sameer


Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Assaf Weinberg | last post by:
Using ASP.NET web form with VB.NET I have a page with a calendar control that onSelectionChanged builds a table control showing the events scheduled for the selected calendar days. One of the...
3
by: Scott | last post by:
I have a clickable graph that resides on page 1. If user clicks a data point on the graph, the page runs again yeilding a 2nd graph that shows a more detailed graph. Problem is, I have a...
7
by: Willem | last post by:
Can someone tell me how I can get a page(any page) on the Internet to refresh automatically every 5 minutes. I was thinking along the lines of having a HTML file on my C-drive with JavaScript to do...
6
by: David | last post by:
Hello. I have such problem: I have ImageButton on my form which is attached to some image like "image.jpg", now when I change image file (physically file) with some other file with the same...
8
by: TS | last post by:
Im in a web page and call an asynchronous method in business class. the call back method is in the web page. When page processes, it runs thru code begins invoking the method then the page...
1
by: achoo | last post by:
Is it possible to extend a Web service proxy so that it understands an HTTP refresh page? Explanation: * The Web service proxy was autogenerated by Visual Studio .NET 2003 from the Web...
10
by: phforum | last post by:
Hi, I wrote a PHP page for user input the information to search the database. And the database data will update every second. I want to set the auto refresh to get the data from database every...
5
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, Recently, I just found out that our program behaves differently from before. in our asp, in order to prevent data disppearing problem in form fields,we use session variable to display...
3
by: tvnaidu | last post by:
How to auto refresh page for every 3 minutes by passing command part of URL?. I need to refresh one page automatically by passing that refresh command part of url, for example if I want to refresh...
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.