Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Get user IP on intranet
Message
De
09/07/2014 13:18:40
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
VB 9.0
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01603311
Message ID:
01603422
Vues:
36
>Thank you (and Viv). For me it is important to log the IP of a user who submits within several seconds. Basically I am troubleshooting the following issue. Users submits duplicate orders by Submitting and then clicking on Back and Submitting again. They claim that they don't do it. And the only way I can prove to them (and to myself) is by logging every Submit with the IP and order number. So two submits within seconds with the consecutive order numbers and the same "IP" will show the trend.

Try to disable the button before submitting the request. That should resolve most of those duplicate-type hits.

Here is an example:
<input type="submit" name="LabelSubmit" value="Cancel" onclick="ButtonOperation(this,'ViewPageGenericConfirmationMessage.aspx');
 return false;" id="LabelSubmit" style="width:150px;" />

function ButtonOperation(toButton,tcUrl,tcMessage)
{
   toButton.disabled=true
   lcMessage=''
   lcUrl=''
   if (tcUrl==null)
   {
      lcUrl=''
   }
   else
   {
      lcUrl=tcUrl
   }
   if (tcMessage==null)
   {
      lcMessage=''
   }
   else
   {
      lcMessage=tcMessage
      lcMessage=lcMessage.replace('\\','\\\\')
      lcMessage=lcMessage.replace("'","\\'")
      lcMessage=lcMessage.replace('"','\\"')
   }
   if (lcMessage.length>0)
   {
      if (confirm(lcMessage))
      {
         if (lcUrl.length>0)
         {
            location.href=lcUrl
         }
         else
         {
            loForm=document.getElementById("Form1")
            loForm.submit()
         }
      }
      else
      {
         toButton.disabled=false
      }
   }
   else
   {
      if (lcUrl.length>0)
      {
         location.href=lcUrl
      }
      else
      {
         loForm=document.getElementById("Form1")
         loForm.submit()
      }
   }
}
It does not have to be that complicated. It is just that I want to support a confirmation message sometimes so I built a generic javascript function for that.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform