Questions related to Post/Get: Trying to pass querystring variables - problems with multiple calls.
Greetings,
---EDIT-----------------------------
Can someone help me answer this question: Using TCPView, I see that browsers often make multiple connections to a website when the URL is requested. Could this be the reason why my VB.Net page is being called so many times from a single Post request? I'm guessing this wouldn't happen in local development mode because it isn't necessary. If this is in fact the culprit, how can I ensure that javascript only sends a single call to my VB.Net page? Thanks!
---------------------------------------
I could use your help. Basically, I need to utilize javascript to send a couple of querystring variables to a VB.Net page. The VB.Net page takes the querystring variables and writes them to a database. I'm already using jQuery on my site and so I tried using the following to pass the variables:
$.post("../tracking/RecordClick.aspx?page=gallery&type=click&item=XYZ");
In local development (using Visual Studio 2010 and either Firefox or IE) this works perfectly and the VB.Net page writes one new record to the database. However, once deployed to the server, invoking the code above results in multiple calls to the VB.Net page (anywhere between 1 and 7) thus creating multiple new records in the database.
To simplify matters, I reduced my test page to a simple button which calls the code above.
Also, If I just enter the full url + querystring into the browser, the server handles the request properly creating a single new record.
I'm sure this is just a limitation of my understanding and I'm hoping you can help me.
Thanks!