日期控件显示问题?
一段完全相同的代码,有一个页面为test.aspx,它上面有一个自定义的日期控件.页面代码为:
<cc1:calendar id= "StartDate " runat= "server " Width= "80px " CssClass= "input "> </cc1:calendar>
<asp:Button id= "Button1 " runat= "server " Width= "104px " Height= "40px " Text= "输出日期 "> </asp:Button>
把这段代码放在服务器A上,查看页面源代码,日期控件的代码为:
<span id= "StartDate " name= "StartDate " style= "width:80px; "> <input name= "StartDate:_ctl0 " type= "text " readonly= "readonly " title= "请点击以选择日期 " class= "input " onfocus= "javascript:calendar() " style= "width:80px;cursor:hand " /> </span>
但放在服务器B上,查看页面源代码,日期控件的源代码则变为了:
<span id= "StartDate " name= "StartDate " style= "width:80px; "> <input name= "StartDate$ctl00 " type= "text " readonly= "readonly " title= "请点击以选择日期 " class= "input " onfocus= "javascript:calendar() " style= "width:80px;cursor:hand " /> </span> ,注意两个name的值,服务器A是name= "StartDate:_ctl0 ",而服务器B中name的值 name= "StartDate$ctl00 "却成了这个,为什么两个服务器下产生的源代码不一样?我另加了一个asp:button控件,在.cs代码中用Response.Write输出这个时间控件的值,结果服务器A输出了你选择的那个正确日期.而服务器B输出的是空.为什么?
------解决方案--------------------2个服务器?1个是1.1另一个是2.0是吧?