Get Data For Java Script Code
<p>I have a piece of code in javascript which calculates something , </p>

<p>There is a label in asp.net application , How can I get the value of it from javascript ? </p>

<p>here is i have tried :</p>

<pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1.Default" %&gt;

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;

&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head runat="server"&gt;
    &lt;title&gt;JASP&lt;/title&gt;
        &lt;script type="text/javascript"&gt;
            var x = document.getElementById("Label1").innerHTML;
            alert(x);
        &lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;form id="form1" runat="server"&gt;
        &lt;asp:Label ID="Label1" runat="server" Text="My Text"&gt;&lt;/asp:Label&gt;
    &lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
