梅花雨控件错位! DateTextBox.ClientID用这个看看用母版页的话取id要用这个 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 什么意思?不明白。js这么取id? DateTextBox.ClientID这个是取控件在html中的id用了母版页的话控件id在html中会改变你看看html的源码就知道了 <%= DateTextBox.ClientID %>这样取 我知道,我的帖子做了一点处理,没想到也没逃过你的眼睛,失敬失敬。原代码是这样的:onclick="calendar(document.getElementById('_ctl0_ContentPlaceHolder1_DateTextBox'));"我是直接这样写的。 谢谢你!Article.aspx<%@ Page Language="C#" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="true" CodeFile="Article.aspx.cs" Inherits="Admin_Article" Title="上海宝山国资委新闻发布系统" ValidateRequest="false"%><%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %><asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <table border="0" cellpadding="5" cellspacing="0"> <tr> <td style="width: 80px"> 新闻标题</td> <td style="width: 800px"> <asp:TextBox ID="TitleTextBox" runat="server" Width="500px"></asp:TextBox></td> </tr> <tr> <td style="width: 80px"> 选择分类</td> <td style="width: 800px"> </td> </tr> <tr> <td colspan="2"> 信息动态</td> </tr> <tr> <td colspan="2"> <asp:RadioButton ID="ReportRadio" runat="server" Text="要闻报道" GroupName="CategoryGroup" Checked="True" /> <asp:RadioButton ID="SpeakRadio" runat="server" Text="领导讲话" GroupName="CategoryGroup" /> <asp:RadioButton ID="TrendsRadio" runat="server" Text="国集资动态" GroupName="CategoryGroup" /> <asp:RadioButton ID="ColumnRadio" runat="server" Text="农村经济专栏" GroupName="CategoryGroup" /> <asp:RadioButton ID="ForumRadio" runat="server" Text="国资论坛" GroupName="CategoryGroup" /> </td> </tr> <tr> <td colspan="2"> 政策法规</td> </tr> <tr> <td colspan="2"> <asp:RadioButton ID="StatuteRadio" runat="server" Text="法律法规" GroupName="CategoryGroup" /> <asp:RadioButton ID="RulesRadio" runat="server" Text="规章制度" GroupName="CategoryGroup" /> <asp:RadioButton ID="EnterpriseRadio" runat="server" Text="企业管理" GroupName="CategoryGroup" /> <asp:RadioButton ID="AdministrationRadio" runat="server" Text="行政事业管理" GroupName="CategoryGroup" /> <asp:RadioButton ID="EcunumyRadio" runat="server" Text="农村集体经济" GroupName="CategoryGroup" /> <asp:RadioButton ID="OperationRadio" runat="server" Text="综合业务" GroupName="CategoryGroup" /> </td> </tr> <tr> <td colspan="2"> 下载园地</td> </tr> <tr> <td colspan="2"> <asp:RadioButton ID="DownloadRadio" runat="server" GroupName="CategoryGroup" Text="下载园地" /></td> </tr> <tr> <td> 日期</td> <td><asp:TextBox ID="DateTextBox" runat="server" onfocus="calendar();"></asp:TextBox> <img src="Images/calendar.gif" onclick="calendar(document.getElementById('_ctl0_ContentPlaceHolder1_DateTextBox'));"/></td> </tr> <tr> <td colspan="2"> 新闻图片</td> </tr> <tr> <td colspan="2"> 图片描述:<asp:TextBox ID="ImageAltText" runat="server" Width="250px"></asp:TextBox> 图片上传<input id="NewsImageFile" type="file" runat="server"/> </td> </tr> <tr> <td colspan="2"> 内容</td> </tr> <tr> <td colspan="2"> <FCKeditorV2:FCKeditor ID="FCKeditor" runat="server" Height="350px" ToolbarSet="SACWeb"> </FCKeditorV2:FCKeditor> </td> </tr> <tr> <td style="width: 80px"> </td> <td style="width: 800px"> <asp:Button ID="SubmitButton" runat="server" Text=" 提交文章 " OnClick="SubmitButton_Click" /></td> </tr> </table> <p> </p> <p> </p> <script language=javascript type="text/javascript"> topMenuThisPage(1); </script></asp:Content> MasterPage.master<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="Admin_MasterPage" %><!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> <link href="../Admin/css-content.css" rel="stylesheet" type="text/css" /> <script language="javascript" type="text/javascript" src="calendar.js"></script> <script language=javascript type="text/javascript"> function topMenuThisPage(n){ var topMenuLi=document.getElementById("Nav").getElementsByTagName("li"); for(i=0;i<topMenuLi.length;i++){ topMenuLi[i].className=""; } topMenuLi[n-1].className="thisPage";} </script></head><body> <form id="form1" runat="server"> <div id="Header"> <div id="Logo"></div> <div id="Welcome"> <asp:Label ID="UserNameLabel" runat="server"></asp:Label></div> <div id="Nav"> <ul> <li><a href="Article.aspx"><span style="font-size:14px;">新闻发布</span></a></li> <li><a href="ArticleList.aspx"><span style="font-size:14px;">新闻管理</span></a></li> <li><a href="Security.aspx"><span style="font-size:14px;">安全设置</span></a></li> </ul> </div> </div> <div id="Body"> <div id="SideBar"></div> <div id="Content"> <asp:contentplaceholder id="ContentPlaceHolder1" runat="server"> </asp:contentplaceholder> </div> </div> <div id="Footer">上海宝山国资委新闻发布系统</div> </form></body></html> textarea 变形绝对难题,have a look 在线等一段javascrip的跳出程序代码 各位大大进来看看 textarea 替換问題...全分... 自己想的无缝滚动.麻烦高手看看.我这能不能实现哦 为什么提示缺少标识符 求这种效果怎么做出来的 求助:公农历换算 怎么通过js控制进纸量 在线求助:如何用程序超链的触发? jsp灰化复选框能不能传值啊,急 javascript 的Function对象中的arguments属性
js这么取id?
这个是取控件在html中的id
用了母版页的话控件id在html中会改变
你看看html的源码就知道了
这样取
<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<table border="0" cellpadding="5" cellspacing="0">
<tr>
<td style="width: 80px">
新闻标题</td>
<td style="width: 800px">
<asp:TextBox ID="TitleTextBox" runat="server" Width="500px"></asp:TextBox></td>
</tr>
<tr>
<td style="width: 80px">
选择分类</td>
<td style="width: 800px">
</td>
</tr>
<tr>
<td colspan="2">
信息动态</td>
</tr>
<tr>
<td colspan="2">
<asp:RadioButton ID="ReportRadio" runat="server" Text="要闻报道" GroupName="CategoryGroup" Checked="True" />
<asp:RadioButton ID="SpeakRadio" runat="server" Text="领导讲话" GroupName="CategoryGroup" />
<asp:RadioButton ID="TrendsRadio" runat="server" Text="国集资动态" GroupName="CategoryGroup" />
<asp:RadioButton ID="ColumnRadio" runat="server" Text="农村经济专栏" GroupName="CategoryGroup" />
<asp:RadioButton ID="ForumRadio" runat="server" Text="国资论坛" GroupName="CategoryGroup" />
</td>
</tr>
<tr>
<td colspan="2">
政策法规</td>
</tr>
<tr>
<td colspan="2">
<asp:RadioButton ID="StatuteRadio" runat="server" Text="法律法规" GroupName="CategoryGroup" />
<asp:RadioButton ID="RulesRadio" runat="server" Text="规章制度" GroupName="CategoryGroup" />
<asp:RadioButton ID="EnterpriseRadio" runat="server" Text="企业管理" GroupName="CategoryGroup" />
<asp:RadioButton ID="AdministrationRadio" runat="server" Text="行政事业管理" GroupName="CategoryGroup" />
<asp:RadioButton ID="EcunumyRadio" runat="server" Text="农村集体经济" GroupName="CategoryGroup" />
<asp:RadioButton ID="OperationRadio" runat="server" Text="综合业务" GroupName="CategoryGroup" />
</td>
</tr>
<tr>
<td colspan="2">
下载园地</td>
</tr>
<tr>
<td colspan="2">
<asp:RadioButton ID="DownloadRadio" runat="server" GroupName="CategoryGroup" Text="下载园地" /></td>
</tr>
<tr>
<td>
日期</td>
<td><asp:TextBox ID="DateTextBox" runat="server" onfocus="calendar();"></asp:TextBox>
<img src="Images/calendar.gif" onclick="calendar(document.getElementById('_ctl0_ContentPlaceHolder1_DateTextBox'));"/></td>
</tr>
<tr>
<td colspan="2">
新闻图片</td>
</tr>
<tr>
<td colspan="2">
图片描述:<asp:TextBox ID="ImageAltText" runat="server" Width="250px"></asp:TextBox>
图片上传<input id="NewsImageFile" type="file" runat="server"/>
</td>
</tr>
<tr>
<td colspan="2">
内容</td>
</tr>
<tr>
<td colspan="2">
<FCKeditorV2:FCKeditor ID="FCKeditor" runat="server" Height="350px" ToolbarSet="SACWeb">
</FCKeditorV2:FCKeditor>
</td>
</tr>
<tr>
<td style="width: 80px">
</td>
<td style="width: 800px">
<asp:Button ID="SubmitButton" runat="server" Text=" 提交文章 " OnClick="SubmitButton_Click" /></td>
</tr>
</table>
<p>
</p>
<p>
</p>
<script language=javascript type="text/javascript">
topMenuThisPage(1);
</script>
</asp:Content>
<head runat="server">
<title>上海宝山国资委新闻发布系统</title>
<link href="../Admin/css-content.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="calendar.js"></script>
<script language=javascript type="text/javascript">
function topMenuThisPage(n){
var topMenuLi=document.getElementById("Nav").getElementsByTagName("li");
for(i=0;i<topMenuLi.length;i++){
topMenuLi[i].className="";
}
topMenuLi[n-1].className="thisPage";
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div id="Header">
<div id="Logo"></div>
<div id="Welcome">
<asp:Label ID="UserNameLabel" runat="server"></asp:Label></div>
<div id="Nav">
<ul>
<li><a href="Article.aspx"><span style="font-size:14px;">新闻发布</span></a></li>
<li><a href="ArticleList.aspx"><span style="font-size:14px;">新闻管理</span></a></li>
<li><a href="Security.aspx"><span style="font-size:14px;">安全设置</span></a></li>
</ul>
</div>
</div>
<div id="Body">
<div id="SideBar"></div>
<div id="Content">
<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
</asp:contentplaceholder>
</div>
</div>
<div id="Footer">上海宝山国资委新闻发布系统</div>
</form>
</body>
</html>