Espo
Espo

Reputation: 41939

How do I track the click on a button with an external PostBackUrl?

On one of my ASP.NET pages I have several asp:textbox fields. On this page there is a "confirm order" button with an external url set in its "PostBackUrl" property.

This works well, and the data is sent to the external site. Here comes the question; how do I know that the user clicked the "confirm order" button on "my side?" (I need this to update my order-status field). There is off course no postback happening on my page becasue the form is submitted to the external site.

Maybe it's possible to use some sort of jQuery to hook on the onclick-event that will call a page that will update my order-status?

Upvotes: 0

Views: 399

Answers (2)

Zhaph - Ben Duguid
Zhaph - Ben Duguid

Reputation: 26966

You'll need to hook into the buttons onClick event, perform a client-side callback to either a web service or Page Method (depending on your preferred setup) on your server to track the click, before allowing the form submission to continue.

Upvotes: 1

UpTheCreek
UpTheCreek

Reputation: 32391

Better to set it up so that the button does perform a postback. Then in your click handler you can update your order-status, and then post the data to the third party.

Upvotes: 0

Related Questions