标签:style blog color io ar strong div sp cti
ASPX:
<table> <tr> <td> <uc1:uccalendar id="ucXudaxia" runat="server" /> </td> </tr> </table>
ASCX:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="UCxdx.ascx.cs" Inherits="UCxdx" %> <asp:TextBox ID="txtXDX" runat="server" CssClass="txtXDX" Width="80px" ></asp:TextBox> <asp:Image ID="showCal" runat="server" /> <asp:Literal ID="litJS" runat="server" ></asp:Literal>
JS:
<script type="text/ecmascript"> function test(){ var t1= document.getElementById(‘<%=ucXudaxia.ClientID%>‘ + "_txtXDX"); // } </script>
PS://用js获取.ascx控件中服务器控件值时首先要得到服务器控件的ClientID再加上.ascx页面里面的服务器空间ID并用"_"连接
标签:style blog color io ar strong div sp cti
原文地址:http://www.cnblogs.com/byvar/p/3983641.html