Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7015131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:36:44+00:00 2026-05-27T22:36:44+00:00

I have two problem. First one, when i click Log In button, localhost wants

  • 0

I have two problem. First one, when i click Log In button, localhost wants to me give allow. but it suddenly disappear in one second. if i double click, it always shows in the bottom like this. then Ajax method run. i want to show this windows always in one click.

My second problem, i want to reach txtUserName in ajax method. i don’t know how to this.

error

Code Behind :

[System.Web.Services.WebMethod]
    public static string SendLocation(object Latitude, object Longitude)
    {
        Core dal_ = new Core();
        Model.Team obj_ = new Model.Team();

        //obj_.UserName = ?????
        obj_.Latitude = Convert.ToDecimal(Latitude);
        obj_.Longitude = Convert.ToDecimal(Longitude);

        dal_.UpdateTeamCoordinat(obj_);
        return "";
    }

JavaScript (in asp.x) :

   <script src="../Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
<script src="js/yqlgeo.js"></script>
<script type="text/javascript">

    function initiate_geolocation() {
        if (navigator.geolocation) {
            navigator.geolocation.getCurrentPosition(handle_geolocation_query, handle_errors);
        }
        else {
            yqlgeo.get('visitor', normalize_yql_response);
        }
    }

    function handle_errors(error) {
        switch (error.code) {
            case error.PERMISSION_DENIED: alert("user did not share geolocation data");
                break;

            case error.POSITION_UNAVAILABLE: alert("could not detect current position");
                break;

            case error.TIMEOUT: alert("retrieving position timedout");
                break;

            default: alert("unknown error");
                break;
        }
    }

    function normalize_yql_response(response) {
        if (response.error) {
            var error = { code: 0 };
            handle_error(error);
            return;
        }

        var position = {
            coords:
        {
            latitude: response.place.centroid.latitude,
            longitude: response.place.centroid.longitude
        },
            address:
        {
            city: response.place.locality2.content,
            region: response.place.admin1.content,
            country: response.place.country.content
        }
        };
        handle_geolocation_query(position);     
    }

    function handle_geolocation_query(position) {
        PageMethods.SendLocation(position.coords.latitude, position.coords.longitude);
    }
</script>

Asp.x:

  <asp:TextBox ID="txtUserName" runat="server"></asp:TextBox>
  <asp:TextBox ID="txtPassword" runat="server" TextMode="Password"></asp:TextBox>
  <asp:Button ID="LoginButton" runat="server" Text="Log In"    OnClientClick="initiate_geolocation()"
                OnClick="LoginButton_Click" />
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T22:36:44+00:00Added an answer on May 27, 2026 at 10:36 pm

    trying to select an element in a webMethod? i would think that would be impossible

    I mostly use WebMethods as FireAndForget type functions.

    if you wanted to select the textbox after firing the function then I would select it using javaScript

    function handle_geolocation_query(position) {
        PageMethods.SendLocation(position.coords.latitude, position.coords.longitude);
    
       //If have JQuery
       var textbox = $('#' + <%=txtUserName.ClientID %>);
    
       //otherwise
       document.getElementById(<%=txtUserName.ClientID %>);    
    }
    

    depending on what you wanted to do with the element depends whether to bother with the JQuery root.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Problem: I have two spreadsheets that each serve different purposes but contain one particular
the problem is that I first have to convert the two-dim to a one-dim,
I actually have two questions regarding the same problem but I think it is
I have encountered a problem in my application. I have two forms, one that
I have created two projects. The first one, extracts information of handset and shows
I have two DIVs, first one has a link in it that contains the
I'm having this problem: I have two Google maps in one page, showing just
A basic C# Problem. I have two disabled textboxes on my form, and one
I have two html text input fields and two buttons. The first button saves
I have two cmake-related problems: first, I can't make it to find the includes

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.