<igsch:WebDateChooser ID="time" NullDateLabel=" " runat="server">
                                    </igsch:WebDateChooser>
在aspx中如何用js获取time的值?

解决方案 »

  1.   

    可以取得  <%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>无标题页</title>
        <script>
            function test(){
                var a = document.getElementById("TextBox1");
                var b = a.value;
                alert(b);
            }
        </script>
    </head><body>
        <form id="form1" runat="server">
        <div>
            &nbsp;<asp:TextBox ID="TextBox1" runat="server" Text="dgq"></asp:TextBox>
            <asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="test()" />
            </div>
        </form>
    </body>
    </html>
      

  2.   

    整个用户控件js是获取不到的,只能使用 Cntrols.ClintID来获得用户控件里的控件
    不如 你有个usercontrols控件 控件里有个label,那么只能使用document.getElementById("").innHTML得到label