问题描述
拖入一个TextBoxWatermarkExtender控件后在IIS里调试时就出现这样的错误AjaxControlToolkit.TextBoxWatermarkExtendermissingrequiredWatermarkTextpropertyvalueforTextBoxWatermarkExtender1.参数名:WatermarkText事实上,我在面版上也没有看到这个属性,而这个属性显然是一定存在的而在前台代码编写中,<ajaxToolkit:TextBoxWatermarkExtender里可以找到这个属性这个情况是怎么一回事呢,是不是ajaxtoolkit安装有问题我装的是1.0正式版(附具体错误:异常详细信息:System.ArgumentException:AjaxControlToolkit.TextBoxWatermarkExtendermissingrequiredWatermarkTextpropertyvalueforTextBoxWatermarkExtender1.参数名:WatermarkText源错误:行736:valid=false;行737:if(throwException){行738:thrownewArgumentException(string.Format(CultureInfo.CurrentCulture,"{0}missingrequired{1}propertyvaluefor{2}.",GetType().ToString(),prop.Name,ID),prop.Name);行739:}行740:}源文件:C:ProgramFilesMicrosoftASP.NETASP.NET2.0AJAXExtensionsv1.0.61025AjaxControlToolkitAjaxControlToolkitExtenderBaseExtenderControlBase.cs行:738堆栈跟踪:[ArgumentException:AjaxControlToolkit.TextBoxWatermarkExtendermissingrequiredWatermarkTextpropertyvalueforTextBoxWatermarkExtender1.参数名:WatermarkText]AjaxControlToolkit.ExtenderControlBase.CheckIfValid(BooleanthrowException)inC:ProgramFilesMicrosoftASP.NETASP.NET2.0AJAXExtensionsv1.0.61025AjaxControlToolkitAjaxControlToolkitExtenderBaseExtenderControlBase.cs:738AjaxControlToolkit.ExtenderControlBase.EnsureValid()inC:ProgramFilesMicrosoftASP.NETASP.NET2.0AJAXExtensionsv1.0.61025AjaxControlToolkitAjaxControlToolkitExtenderBaseExtenderControlBase.cs:752AjaxControlToolkit.ExtenderControlBase.GetScriptDescriptors(ControltargetControl)inC:ProgramFilesMicrosoftASP.NETASP.NET2.0AJAXExtensionsv1.0.61025AjaxControlToolkitAjaxControlToolkitExtenderBaseExtenderControlBase.cs:400System.Web.UI.ExtenderControl.System.Web.UI.IExtenderControl.GetScriptDescriptors(ControltargetControl)+7System.Web.UI.ScriptControlManager.RegisterScriptDescriptors(IExtenderControlextenderControl)+201System.Web.UI.ScriptManager.RegisterScriptDescriptors(IExtenderControlextenderControl)+52System.Web.UI.ExtenderControl.Render(HtmlTextWriterwriter)+39AjaxControlToolkit.ExtenderControlBase.Render(HtmlTextWriterwriter)inC:ProgramFilesMicrosoftASP.NETASP.NET2.0AJAXExtensionsv1.0.61025AjaxControlToolkitAjaxControlToolkitExtenderBaseExtenderControlBase.cs:340System.Web.UI.Control.RenderControlInternal(HtmlTextWriterwriter,ControlAdapteradapter)+25System.Web.UI.Control.RenderControl(HtmlTextWriterwriter,ControlAdapteradapter)+121System.Web.UI.Control.RenderControl(HtmlTextWriterwriter)+22System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriterwriter,ICollectionchildren)+130System.Web.UI.Control.RenderChildren(HtmlTextWriterwriter)+24System.Web.UI.Control.Render(HtmlTextWriterwriter)+7System.Web.UI.Control.RenderControlInternal(HtmlTextWriterwriter,ControlAdapteradapter)+25System.Web.UI.Control.RenderControl(HtmlTextWriterwriter,ControlAdapteradapter)+121System.Web.UI.Control.RenderControl(HtmlTextWriterwriter)+22System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriterwriter,ICollectionchildren)+130System.Web.UI.Control.RenderChildren(HtmlTextWriterwriter)+24System.Web.UI.UpdatePanel.RenderChildren(HtmlTextWriterwriter)+236System.Web.UI.Control.Render(HtmlTextWriterwriter)+7System.Web.UI.UpdatePanel.Render(HtmlTextWriterwriter)+32System.Web.UI.Control.RenderControlInternal(HtmlTextWriterwriter,ControlAdapteradapter)+25System.Web.UI.Control.RenderControl(HtmlTextWriterwriter,ControlAdapteradapter)+121System.Web.UI.Control.RenderControl(HtmlTextWriterwriter)+22System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriterwriter,ICollectionchildren)+130System.Web.UI.Control.RenderChildren(HtmlTextWriterwriter)+24System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriterwriter)+59System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriteroutput)+68System.Web.UI.Control.RenderControlInternal(HtmlTextWriterwriter,ControlAdapteradapter)+25System.Web.UI.Control.RenderControl(HtmlTextWriterwriter,ControlAdapteradapter)+121System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriterwriter)+37System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriterwriter,ICollectionchildren)+130System.Web.UI.Control.RenderChildren(HtmlTextWriterwriter)+24System.Web.UI.Page.Render(HtmlTextWriterwriter)+26System.Web.UI.Control.RenderControlInternal(HtmlTextWriterwriter,ControlAdapteradapter)+25System.Web.UI.Control.RenderControl(HtmlTextWriterwriter,ControlAdapteradapter)+121System.Web.UI.Control.RenderControl(HtmlTextWriterwriter)+22System.Web.UI.Page.ProcessRequestMain(BooleanincludeStagesBeforeAsyncPoint,BooleanincludeStagesAfterAsyncPoint)+1896--------------------------------------------------------------------------------版本信息:Microsoft.NETFramework版本:2.0.50727.832;ASP.NET版本:2.0.50727.832
解决方案
解决方案二:
TextBoxWatermarkExtender需要有TextBox控件进行对应吧
解决方案三:
TextBoxWatermarkExtender需要有TextBox控件进行对应吧
解决方案四:
"TextBoxWatermarkExtender需要有TextBox控件进行对应吧",就是说TextBoxWatermarkExtender控件必须和某个TextBox控件关联才能用!我了正在学习asp.netajax!用了TabContainer和TabPanel感觉还不错!用起来挺方便的!