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

  • SEARCH
  • Home
  • 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 8464169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:39:35+00:00 2026-06-10T14:39:35+00:00

I have two labels: <asp:Label ID=Label1 runat=server Text=Label></asp:Label> <asp:Label ID=Label2 runat=server Text=Label></asp:Label> and I

  • 0

I have two labels:

  <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
  <asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>

and I set innerHTML by javascript:

document.getElementById('Label1').innerHTML = position.lat();
document.getElementById('Label2').innerHTML = position.lng();

How I can get those labels values in codebehind? I try:

TextBox2.Text = Label1.Text;

UPDATE:I need to get pushpin location:

  <artem:GoogleMap ID="GoogleMap1" runat="server" 
    EnableMapTypeControl="False" MapType="Roadmap" >        
  </artem:GoogleMap>      
  <artem:GoogleMarkers ID="GoogleMarkers1" runat="server" 
    TargetControlID="GoogleMap1" onclientpositionchanged="handlePositionChanged">
  </artem:GoogleMarkers> 
  <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
  <asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>

<script type="text/javascript">
  var list = document.getElementById("Label1");
  function handlePositionChanged(sender, e) {
    printEvent("Position Changed", sender, e);
  }
  function printEvent(name, sender, e) {
    var position = e.latLng || sender.markers[e.index].getPosition();
    document.getElementById('Label1').innerHTML = position.lat();
    document.getElementById('Label2').innerHTML = position.lng();
  }
</script>

protected void Button1_Click(object sender, EventArgs e)
{
    TextBox2.Text = Label1.Text;// return value: Label
}
  • 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-06-10T14:39:36+00:00Added an answer on June 10, 2026 at 2:39 pm

    You cannot access the value on server side. You will have to use a hidden field for that:

    <asp:HiddenField ID="Hidden1" runat="server" />
    

    The set the innerHtml value in the Hidden field by doing:

    document.getElementById('<%= Hidden1.ClientID %>').value = position.lat();
    

    You can then access it from server side by doing:

    TextBox1.Text = Hidden1.Value;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two listitems and the postback and run a function. <asp:RadioButtonList runat=server CssClass=ccsw
I have defined a placeholder in my page like this; <asp:PlaceHolder ID=attrPlaceHolder runat=server></asp:PlaceHolder> I
<div> <asp:Label ID=lblClientId runat=server CssClass=label meta:resourcekey=lblClientIdResource /> <asp:TextBox ID=tbClientId runat=server style=width:150px; /> <asp:Button ID=btnClientId
I have two labels (A and B) in a Flex VBox, with the horizontal
I have two labels that are stacked. If I want a horizontal line between
For Android I have two labels in a table row. I am trying to
I've created a skin that allows me to have two labels on a spark
I have a view which has two labels. When I swipe left I fill
I have to do a user registration form (classical layout with two columns, labels
My storyboard seems locked. I have added new labels and imageviews to two different

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.