Click to See Complete Forum and Search --> : [RESOLVED] Postback Eventtarget Problem


birre
05-07-2007, 09:10 AM
Hi,

I'm using 2.0 framework.
On my site, i have an image (arrow) that causes a postback via javascript:

function clickVolgendeWn()
{
__doPostBack('volgendeWn','')
}

in my .net code, this will be firing :

If (Page.Request.Form("__EventTarget") = "volgendeWn") Then
'wanneer op volgende werknemer geklikt werd, zal de module bVolgendeWn_Click ingeladen worden
bVolgendeWn_Click(Me, New System.Web.UI.ImageClickEventArgs(0, 0))
End If

Everything is working fine, the only problem is, when I press the arrow, the event is firing great, but when i press F5, the event will fire again... while it shouldn't!!!

Is there anything possible to check wether it's an F5 postback or not?

Tnx in advance!

Ribeyed
05-07-2007, 10:26 AM
F5 doesn't fire a postback it refreshes the page.

birre
05-07-2007, 10:30 AM
Exactly the problem. Because of the recent postbacks because of the image, when I hit F5, it says Page.IsPostBack = True

Ribeyed
05-07-2007, 12:20 PM
can you not disable the postback on the image?

abhi_viking
05-08-2007, 12:01 AM
birre,

Go through this link http://http://www.codeproject.com/aspnet/Detecting_Refresh.asp. This may solve your issue.

The other way to solve the problem you are facing is by disabling F5 ie; Refresh through javascript on that page, but that would disable all the F5s for that page.

birre
05-08-2007, 02:57 AM
Thanks for the link, it works great! :D