473,695 Members | 2,405 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 10045
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.Redire ct(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.Redire ct, 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.Redire ct(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.Redire ct, 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.Redire ct(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
13558
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 columns in this table contains linkbuttons that, when clicked, should execute some code (currently an event handler called showEvent) that displays details. I am currently using addhandler to specify the handler for
3
12916
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 recordset table on the 2nd graph page and because the user gets to it by clicking the graph, the page doesn't properly post to render the recordset table. I can click "Refresh" on 2nd page and table displays fine. Is there an ASP refresh command that...
7
40201
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 so. It should be possible, Right? I don't know much about JavaScript. Thanks for the help.
6
3669
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 name my page shows the old image until I click "Refresh" button of the browser. So how can I refresh web form from code? Or may be there is some other way to solve this problem?
8
5859
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 unloads. When the callback method is raised, only the method in the web page is run and the page never refreshes, it seems it all happens on the server side. I am trying to refresh the constrols on the page inside the callback method, but when id...
1
2262
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 service's WSDL. It inherits from System.Web.Services.Protocols.SoapHttpClientProtocol. * The Web service is hiding behind a load-balancing content switch
10
32874
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 minute. But the page always display the dialog box ask me to resend the information. How to disable this warning message. I using POST and REQUEST to get the data from user input page. Thanks all
5
2654
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 the field values if a customer click "back" button on the page2.asp in the browser,(the session variables Session(aQuoteName(iPerson)&"TripCost") is set up in the page2.asp) i.e. then in the page1.asp, we use: <input name="<%=aQuoteName(iPerson)&...
3
9869
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 my-own-web-page.com: some URL like this to auto reload? http://www.my-own-web-page.com?auto-refresh=3
0
9137
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9004
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8864
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8838
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5842
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4351
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4592
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3025
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2289
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.