title: innerHtml with ASP.NET and JQuery Mobile
body: <p>I'm working on a mobile search, that uses your location to determine a zip code server side, but when trying to set two labels to the latitude and longitude to send to the server, I get an error claiming that the innerHtml is null. Upon further inspection, the element is null. Why could this be?</p>
  
  <pre><code>&lt;%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Search.Default" %&gt;
  &lt;asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"&gt;
  &lt;/asp:Content&gt;
  &lt;asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"&gt;
  &lt;script language="javascript" type="text/javascript"&gt;
      navigator.geolocation.getCurrentPosition(foundLocation, noLocation);
      var latitude;
      var longitude;
      function foundLocation(position) {
          latitude = position.coords.latitude;
          longitude = position.coords.longitude;
          alert('Your location: ' + latitude + ', ' + longitude);
      }
      function noLocation() {
          //Do something here in the case that no location is found, or user denies access
      }
      function getLocation() {
          document.getElementById("ct100_ContentPlaceHolder1_lblLat").innerHtml = latitude;
          document.getElementById("ct100_ContentPlaceHolder1_lblLong").innerHtml = longitude;
      }
  &lt;/script&gt;   
  &lt;div data-role="page"&gt;
      &lt;div data-role="header"&gt;
          &lt;h1&gt;Provider Search&lt;/h1&gt;
      &lt;/div&gt;
      &lt;div data-role="content"&gt;
          &lt;asp:Button ID="btnSearch" Text="Search" runat="server" data-role="button" OnClientClick="getLocation()" OnClick="btnSearch_Clicked"&gt;&lt;/asp:Button&gt;
          &lt;asp:Label ID="lblLat" runat="server"&gt;&lt;/asp:Label&gt;
          &lt;asp:Label ID="lblLong" runat="server"&gt;&lt;/asp:Label&gt;
          &lt;p&gt;&lt;/p&gt; 
  
      &lt;/div&gt;
  
  &lt;/div&gt;
  
  &lt;/asp:Content&gt;
  </code></pre>
  
  <p>I'd like to note that everything in this document is working perfectly, except for the setting of the labels.</p>
  
  <p>Also, the ID prefix ct100_ContentPlaceHolder1_ is generated by asp.net during runtime, and this can be confirmed by looking at the page source when I am debugging.</p>
  
  <p>Any help?</p>