#1
  1. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Jan 2016
    Posts
    1
    Rep Power
    0

    Help with if function


    Hi all,

    I am new to this forum and also very new to the .net language. I have some experience with php and if functions but I am now trying to learn a little more about .net.

    I have a basic website built using .net. I want to add in an if function to the html. So if a customer is from the UK then it will display the symbol . But for any other country it will display $.

    I know I need to add an if function for this but I am not sure where / how. Also, how do I tell the website to check a customers location to decide if they are from the UK or another country?

    Any help would be greatly appreciated, Im really struggling with this one.

    Thanks in advance
    Chris
  2. #2
  3. No Profile Picture
    Registered User

    Join Date
    Aug 2015
    Posts
    5
    Rep Power
    0
    HI aspbeg.
    Though I am not an expert in ASP.NET. but I can help you in determining any user's geographical location who is surfing your web application.
    Here is the code.

    window.onload = function()
    {
    var startPos;
    var geoSuccess = function(position) {
    startPos = position;
    document.getElementById('startLat').innerHTML = startPos.coords.latitude;
    document.getElementById('startLon').innerHTML = startPos.coords.longitude;
    };
    navigator.geolocation.getCurrentPosition(geoSucces s);
    };
    I hope it will be helpful for you.

Similar Threads

  1. How to call VBScript function from Javascript Function?
    By zwieback89 in forum HTML, JavaScript And CSS Help
    Replies: 3
    Last Post: November 2nd, 2006, 04:36 PM
  2. How to call jscript function from vbscript function
    By Narasim.kulkarn in forum ASP Development
    Replies: 1
    Last Post: September 26th, 2006, 08:48 AM
  3. Combining Function OnChk & function toggleSubmit(sel)
    By Devine in forum HTML, JavaScript And CSS Help
    Replies: 8
    Last Post: June 29th, 2006, 12:44 AM
  4. Now Function to Convert to Date Function
    By Caliboi in forum Microsoft Access Help
    Replies: 1
    Last Post: May 25th, 2006, 11:08 AM
  5. Replies: 1
    Last Post: August 4th, 2003, 03:43 PM

IMN logo majestic logo threadwatch logo seochat tools logo