CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
可用分押宝游戏火热进行中... 专题改版:Java Web 专题
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  .NET技术 >  ASP.NET

我的vs2003不能识别<button></button>控件,怎么解决呢?

楼主yezhutou(向天朱)2006-03-04 14:53:24 在 .NET技术 / ASP.NET 提问

在HTML   spec   4.0里,增加了一个BUTTON元素,并且IE4.0就已经开始支持<BUTTON>了,  
  表达方式是<button><img   align='absmiddle'   src='/Emoticons/emnote.gif'>Sing   Song</button>    
   
  我的vs不识别,该怎么办呢?  
   
  还有,我用这个button控件onfocus的函数编写的一段js脚本语句在我的本地机上可以实现,但是在别的机子上就不能实现,提示是"对像不支持该方法或属性",这是为什么啊?别的机子是不是没有编译器啊?还是什么原因啊?搞不清楚,大家帮忙 问题点数:20、回复次数:5Top

1 楼net_lover(【孟子E章】)回复于 2006-03-04 15:02:37 得分 0

<input   type=button   style="background:url('/Emoticons/emnote.gif')"   value="ok">Top

2 楼net_lover(【孟子E章】)回复于 2006-03-04 15:03:07 得分 0

贴你   的js代码Top

3 楼yezhutou(向天朱)回复于 2006-03-04 15:11:17 得分 0

我这是一个三个页面的调用:  
   
  首先是calendar.aspx:  
  <object   id=sptCal   style="position:   absolute;   height:   0px;   left:   0px;   top:   0px;   width:   0px;   z-index:   101"   type=text/x-scriptlet   viewastext>  
  <param   name="URL"   value="../PublicAsp/UtlCalendar.aspx"></object>  
  </div>  
  <SCRIPT   LANGUAGE=javascript>  
  <!--  
  var   _Calendar_window_onload_timer   =   null  
  function   _Calendar_window_onload()  
  {  
  if   (_Calendar_window_onload_timer   !=   null)   window.clearTimeout(_Calendar_window_onload_timer);  
  try  
  {  
  sptCal.Initialize(sptCal);  
  }  
  catch(e)  
  {  
  _Calendar_window_onload_timer   =   window.setTimeout("_Calendar_window_onload()",500);  
  }  
  }  
  _Calendar_window_onload_timer   =   window.setTimeout("_Calendar_window_onload()",500);  
  //-->  
  </SCRIPT>Top

4 楼yezhutou(向天朱)回复于 2006-03-04 15:15:54 得分 0

Ultcalendar.aspx中的js代码是:  
  <script   LANGUAGE="javascript">  
  <!--  
  var   m_DateValue   =   "";  
  var   m_self   =   "";  
  var   m_MarkDiv   =   null;  
  var   m_DateTextBox   =   null;  
  var   m_DateBtn   =   null;  
  var   m_disableFlag   =   false;  
  var   m_ondblclick   =   null; //   Event:   Fire   when   double   click    
   
  document.onselectstart   =   document_DisableSelect;  
  function   document_DisableSelect()  
  {  
  return   false;  
  }  
   
  function   window_onload()  
  {  
  var   strYear,strMonth,strDate,strDay;  
  var   dtCurrent=new   Date();  
  strYear=   dtCurrent.getYear();  
  strMonth=   dtCurrent.getMonth();  
  strDate=   dtCurrent.getDate();  
  strDay=   dtCurrent.getDay();//weekday   0   stand   for   Sunday  
  sltMonth.selectedIndex   =   strMonth;  
  window.txtYear.value=strYear;//set   the   year  
  //set   the   first   day   to   the   weekday  
  var   iWeekDate,iHowManyDays,strTemp;  
  iWeekDate=(new   Date(strYear,strMonth,1)).getDay();  
  strTemp=strMonth+1;  
  iHowManyDays=HowManyDays(strTemp,strYear);  
  setDaysToCalendar(iWeekDate,iHowManyDays,strDate);  
  m_DateValue=FormateDate(strYear,strTemp,strDate);  
  if   (m_DateTextBox   !=   null)  
  m_DateTextBox.value   =   m_DateValue;  
   
  }  
   
  function   sleOnClick()  
  {  
  var   strMonth;  
  var   strYear;  
  var   strDate;  
  var   iWeekDate;  
  var   iHowManyDays;  
  strYear=window.txtYear.value   ;  
  strMonth=window.sltMonth.value   ;  
  iWeekDate   =   (new   Date(strYear,strMonth-1,1)).getDay();  
  iHowManyDays=HowManyDays(strMonth,strYear);  
  strDate=WhichDaySelected();  
  WriteNullToCalendar();  
  ResetbgColor();  
  setDaysToCalendar(iWeekDate,iHowManyDays,strDate);  
  m_DateValue=FormateDate(strYear,strMonth,strDate);  
  m_Self.style.height=tblTotalCalendar.clientHeight+2;  
  if   (m_DateTextBox   !=   null)  
  m_DateTextBox.value   =   m_DateValue;  
  }  
   
  var   objLink;  
  function   imgUpOnclick()  
  {  
  var   strYear;  
  strYear=txtYear.value;  
  strYear=parseInt(strYear)+1;  
  if   (strYear==100)   strYear=2000;  
  txtYear.value=strYear;  
  strMonth=window.sltMonth.value   ;  
  iWeekDate   =   (new   Date(strYear,strMonth-1,1)).getDay();  
  iHowManyDays=HowManyDays(strMonth,strYear);  
  strDate=WhichDaySelected();  
  WriteNullToCalendar();  
  ResetbgColor();  
  setDaysToCalendar(iWeekDate,iHowManyDays,strDate);  
  m_DateValue=FormateDate(strYear,strMonth,strDate);  
  m_Self.style.height=tblTotalCalendar.clientHeight+2;  
  if   (m_DateTextBox   !=   null)  
  m_DateTextBox.value   =   m_DateValue;  
  }  
   
  function   imgDownOnclick()  
  {  
  var   strYear;  
  strYear=txtYear.value;  
  strYear=parseInt(strYear)-1;  
  txtYear.value=strYear;  
  strMonth=window.sltMonth.value   ;  
  iWeekDate   =   (new   Date(strYear,strMonth-1,1)).getDay();  
  iHowManyDays=HowManyDays(strMonth,strYear);  
  strDate=WhichDaySelected();  
  WriteNullToCalendar();  
  ResetbgColor();  
  setDaysToCalendar(iWeekDate,iHowManyDays,strDate);  
  m_DateValue=FormateDate(strYear,strMonth,strDate);  
  m_Self.style.height=tblTotalCalendar.clientHeight+2;  
  if   (m_DateTextBox   !=   null)  
  m_DateTextBox.value   =   m_DateValue;  
  }  
   
  function   txtYearOnchange()  
  {  
  var   strYear,strMonth,strDate  
  strYear=txtYear.value  
  strMonth=window.sltMonth.value    
  iWeekDate   =   (new   Date(strYear,strMonth-1,1)).getDay();  
  iHowManyDays=HowManyDays(strMonth,strYear);  
  strDate=WhichDaySelected();  
  WriteNullToCalendar();  
  ResetbgColor();  
  setDaysToCalendar(iWeekDate,iHowManyDays,strDate);  
  m_DateValue=FormateDate(strYear,strMonth,strDate)  
  m_Self.style.height=tblTotalCalendar.clientHeight+2;  
  if   (m_DateTextBox   !=   null)  
  m_DateTextBox.value   =   m_DateValue;  
  }  
   
  function   tdOnclick()  
  {  
  var   src   =   event.srcElement    
  if   (src.tagName   !=   "TD")return   false;  
  var     strYear,strMonth,strDate  
  if   (src.innerText!=""   &&   src.innerText!="   ")  
  {  
  ResetbgColor();  
  src.style.backgroundColor   =   "#8991c8";  
  //src.className="selectTD";    
  src.Active   =   true;  
  m_tdActive   =   src;  
  strYear=txtYear.value;  
  strMonth=window.sltMonth.value;    
  strDate=src.innerText;  
  m_DateValue=FormateDate(strYear,strMonth,strDate);  
  if   (m_DateTextBox   !=   null)  
  m_DateTextBox.value   =   m_DateValue;  
  }  
  }  
   
  function   tdOndblclick()  
  {  
  var   src   =   event.srcElement    
  if   (src.tagName   !=   "TD")return   false;  
  if   (src.innerText!=""   &&   src.innerText!="   ")  
  {  
  hide();  
  if   (m_ondblclick   !=   null)  
  m_ondblclick(m_DateTextBox);  
  }  
  }  
   
  /************************************************************************  
  Property: DateValue  
  purpose:  
  return   : readOnly return   selected   date  
  ************************************************************************/  
  function   public_get_DateValue()  
  {  
  return   m_DateValue;  
  }  
   
  /************************************************************************  
  Method: Initialize(self)  
  purpose:  
  return   :  
  ************************************************************************/  
  function   public_Initialize(self)  
  {  
  m_Self   =   self  
  m_MarkDiv   =   self.parentElement;  
  }  
   
  /************************************************************************  
  Method: LinkObj(txtObj,btnObj)  
  purpose:  
  parameters: txtObj object   of   text btnObj object   of   button  
  return   : readOnly return   selected   date  
  ************************************************************************/  
  function   public_linkObj(txtObj,btnObj)  
  {  
  m_DateTextBox   =   txtObj;  
  m_DateBtn   =   btnObj;  
  m_DateBtn.onclick   =   show;  
  }  
   
  /************************************************************************  
  Method: ClearLink()  
  purpose:  
  parameters:  
  return   :  
  ************************************************************************/  
  function   public_clearLink()  
  {  
  m_DateTextBox   =   null;  
  m_DateBtn.onclick   =   null;  
  m_DateBtn   =   null;  
  }  
   
  /************************************************************************  
  Property: disable  
  purpose:  
  parameters:  
  return   : read   /   write true   /   false  
  ************************************************************************/  
  function   public_put_disable(bFlag)  
  {  
  m_disableFlag   =   bFlag;  
  hide();  
  return   0;  
  }  
   
  function   public_get_disable()  
  {  
  return   m_disableFlag;  
  }  
   
  /************************************************************************  
  Event: ondblclick  
  purpose:  
  parameters:  
  return   :  
  ************************************************************************/  
  function   public_put_onDblClick(funP)  
  {  
  m_ondblclick   =   funP;  
  }  
   
  function   show()  
  {  
  if   (m_disableFlag   ==   true)  
  return   -1  
  if   (m_Self.style.visibility   ==   "visible")  
  {  
  hide();  
  return   0  
  }  
  m_MarkDiv.style.visibility   =   "visible";  
  m_MarkDiv.onclick   =   hide;  
  var   offSrc   =   m_DateTextBox.offsetParent;;  
  var   offX   =   m_DateTextBox.offsetLeft  
  var   offY   =   m_DateTextBox.offsetTop  
  while(offSrc.tagName!="BODY")  
  {  
  offX   =   offX   +   offSrc.offsetLeft;  
  offY   =   offY   +   offSrc.offsetTop;  
  offSrc   =   offSrc.offsetParent;  
  }  
  m_Self.style.width=tblTotalCalendar.clientWidth   +   2  
  //m_Self.style.width=191;  
  m_Self.style.height=tblTotalCalendar.clientHeight   +   2  
  if   (offX   >   m_Self.parentElement.clientWidth   -   tblTotalCalendar.clientWidth)  
  m_Self.style.left   =   m_Self.parentElement.clientWidth   -   tblTotalCalendar.clientWidth-2;  
  else  
  m_Self.style.left   =offX;  
  if   (offY   >   m_Self.parentElement.clientHeight   -   tblTotalCalendar.clientHeight)  
  m_Self.style.top   =offY   -   tblTotalCalendar.clientHeight;  
  else  
  m_Self.style.top   =offY   +   m_DateTextBox.clientHeight;  
  m_Self.style.visibility="visible";  
  return   0  
  }  
   
  function   hide()  
  {  
  m_MarkDiv.style.visibility   =   "hidden";  
  m_Self.style.visibility   =   "hidden"  
  }  
  //-->  
  </script>Top

5 楼yezhutou(向天朱)回复于 2006-03-04 15:19:58 得分 0

txtDate.aspx是在和calendar.aspx的同级页面中调用的,txtDate.aspx的调用方式是:  
  <object   id="txtIssueTime"   data="../PublicAsp/TxtDate.aspx"   name="txtIssueTime"   style="HEIGHT:   22px;   LEFT:   0px;   TOP:   0px;   WIDTH:   110px"   tabindex="100"   type="text/x-scriptlet"   viewastext>  
  </OBJECT>  
   
  而calendar.aspx是include进去的:<!--#include   file="../PublicAsp/Calendar.aspx"-->  
  txtDate.aspx的代码是:  
  <HTML>  
      <HEAD>  
  <title>   <%=Application["Title"]%>  
  </title>  
  <meta   http-equiv="Content-Type"   content="text/html;   charset=gb2312">  
  <style>   INPUT.txtClass   {   font-size:   8pt;   font-family:   Arial;   height:   16;   border-top:none;   border-left:none;   border-right:none;   border-bottom:1px   #000000   solid;   background-color:"Gainsboro";   color:black;   }  
  TD.broder{   border-top:   solid   1   #000000;   border-left:   solid   1   #000000;   border-right:   solid   1   #ffffff;   border-bottom:   solid   1   #ffffff;   background:   #ffffff;   font-size:   8pt;   font-family:   arial;   width   :   87;   height   :   16;   }  
  DIV.OutSide{   border-top:   solid   1   #808080;   border-left:   solid   1   #808080;   border-right:   solid   1   #c0c0c0;   border-bottom:   solid   1   #c0c0c0;   font-size:   8pt;   font-family:   arial;   width   :   87;   height   :   16;   }  
  IMG.inactive{   filter:   gray;   width:   21;   height:   21;   }  
  </style>  
  <script   language="javascript">  
  <!--  
  var   m_txtID   =   new   Array(3)  
  var   m_disableFlag   =   false;  
  var   m_datevalue;  
  var   m_onReady   =   null; //Event   ;  
   
  m_txtID[0]   =   "txtDay";  
  m_txtID[1]   =   "txtYear";  
  m_txtID[2]   =   "txtMonth";  
   
  document.onselectstart   =   DisableSelectOnWindow;  
  document.ondragstart   =   Function("return   false;");  
  function   DisableSelectOnWindow()  
  {  
  var   src   =   event.srcElement;  
  if     (src.tagName   ==   "INPUT"   &&   src.readOnly   !=   true)  
  {  
  return   true;  
  }  
  return   false;  
  }  
   
  function   window.onload()  
  {  
  Form1.txtMonth.onkeypress   =   CheckNumber;  
  Form1.txtDay.onkeypress   =   CheckNumber;  
  Form1.txtYear.onkeypress   =   CheckNumber;  
  }  
   
  function   window.onfocus()  
  {  
  if   (document.activeElement.id   !=   "txtDay")  
  {  
  Form1.txtDay.select();  
  Form1.txtDay.focus();  
  }  
  }  
   
  function   txt_onblur(Element)  
  {  
  switch   (Element.id)  
  {  
  case   "txtMonth":  
  if   (parseFloat(Form1.txtMonth.value)<1   ||   parseFloat(Form1.txtMonth.value)>12)  
  {  
  Form1.txtMonth.value   =   "";  
  Form1.txtMonth.select();  
  return   false;  
  }  
  if   (Form1.txtMonth.value.length<2&&Form1.txtMonth.value!="")  
  Form1.txtMonth.value   =   "0"+Form1.txtMonth.value;  
  if   (Form1.txtYear.value   !=   ""   &&   Form1.txtDay.value   !=   "")  
  {  
  if   (isDate(getDate()))  
  {  
  if   (m_onReady!=null)  
  m_onReady();  
  }  
  else  
  {  
  Form1.txtDay.value   =   "";  
  Form1.txtDay.select();  
  }  
  }  
  break;  
  case   "txtDay":  
  if   (parseFloat(Form1.txtDay.value)<1   ||   parseFloat(Form1.txtDay.value)>31)  
  {  
  Form1.txtDay.value   =   ""  
  Form1.txtDay.select();  
  return   false;  
  }  
  if   (Element.value.length<2&&Element.value!="")  
  Element.value   =   "0"+Element.value;  
  if   (Form1.txtMonth.value   !=   ""   &&   Form1.txtYear.value   !=   "")  
  {  
  if   (isDate(getDate()))  
  {  
  if   (m_onReady!=null)  
  m_onReady();  
  }  
  else  
  {  
  Form1.txtDay.value   =   "";  
  Form1.txtDay.select();  
  }  
  }  
  break;  
  case   "txtYear":  
  if   (Form1.txtMonth.value   ==   ""   &&   Form1.txtDay.value   ==   ""   &&   Form1.txtYear.value   ==   "")  
  break;  
  if   (parseFloat(Form1.txtYear.value)<1900)  
  {  
  Form1.txtYear.value   =   "";  
  Form1.txtYear.select();  
  return   false;  
  }  
  if   (Form1.txtMonth.value   ==   "")  
  {  
  Form1.txtMonth.focus();  
  return;  
  }  
  if   (Form1.txtDay.value   ==   "")  
  {  
  Form1.txtDay.focus();  
  return;  
  }  
  if   (Form1.txtYear.value   !=   "")  
  {  
  if   (isDate(getDate()))  
  {  
  if   (m_onReady!=null)  
  m_onReady();  
  }  
  else  
  {  
  Form1.txtDay.value   =   "";  
  Form1.txtDay.select();  
  }  
  }  
  break;  
  }  
  return   true;  
  }Top

相关问题

  • Falt_Button控件
  • 用MEDIAPLAYER控件怎样识别声道?
  • 急求button控件
  • HyperLink web控件 和 Button web控件?
  • 关于web控件中的table控件中加入button控件
  • 在窗体中无法识别 DATA REPORTER中的控件
  • 识别表单控件内容是否为中文编码
  • data控件为什么不能识别.mdb格式了!
  • 有没有能识别java编写的控件的Spy++
  • 在网页上的内置控件如:input type=button。我想自定义一个类似的也被网页识别!在网页支持html的控件中也被支持

关键词

  • vs
  • 代码
  • js
  • 页面
  • txtdate
  • 识别
  • 调用
  • 机子
  • js代码
  • aspx

得分解答快速导航

  • 帖主:yezhutou

相关链接

  • CSDN .NET频道
  • .NET类图书
  • C#类图书
  • .NET类源码下载

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
世纪乐知(北京)网络技术有限公司 版权所有, 京 ICP 证 020026 号
北京创新乐知广告有限公司 提供技术支持
Copyright © 2000-2007, CSDN.NET, All Rights Reserved
GongshangLogo