Microsoft Jscript运行时错误:无法设置属性"dispose"的值:object为null或未定义 [英] Microsoft Jscript runtime error:Unable to set value of the property ‘dispose’:object is null or undefined
问题描述
大家好,
我正在使用类似
的验证摘要
Hi All,
I am Using Validation Summary like
<asp:ValidationSummary ID="VSChangePassword1" runat ="server" ShowMessageBox ="true" ShowSummary ="false"
ValidationGroup ="VGChangePassword1" DisplayMode="List" />
我有3个文本框& 1我页面中的提交"按钮,即旧密码",新密码",重新输入新密码"和提交.
如果我在文本框中没有提供任何信息,单击提交"按钮,然后显示验证摘要"消息框,如
请输入旧密码,请输入新密码&请输入重新输入新密码.
如果我给所有正确的&单击提交按钮,它会显示以下脚本错误,即
Microsoft Jscript运行时错误:无法设置属性"dispose"的值:对象为null或未定义
I have 3 text boxes & 1 Submit button in my page i.e., Old Password, New Password, Re-Type New Password & Submit.
If I don’t given anything in textboxes & click on Submit button then it is showing Validation Summary Message Box like
Please enter Old Password, Please enter New Password & Please enter Re-Type New Password.
If I gave all correct & click on submit button it is showing following Script error i.e.,
Microsoft Jscript runtime error:Unable to set value of the property ‘dispose’:object is null or undefined
<script type="text/javascript">
//<![CDATA[
(function() {var fn = function() {$get("ctl00_ToolkitScriptManager1_HiddenField").value = '';Sys.Application.remove_init(fn);};Sys.Application.add_init(fn);})();var ctl00_RCMMenu_Data = new Object();
ctl00_RCMMenu_Data.disappearAfter = 500;
ctl00_RCMMenu_Data.horizontalOffset = 0;
ctl00_RCMMenu_Data.verticalOffset = 0;
ctl00_RCMMenu_Data.hoverClass = 'ctl00_RCMMenu_16 DynamicItemHover';
ctl00_RCMMenu_Data.hoverHyperLinkClass = 'ctl00_RCMMenu_15 DynamicItemHover';
ctl00_RCMMenu_Data.staticHoverClass = 'ctl00_RCMMenu_14 StaticMenuHover';
ctl00_RCMMenu_Data.staticHoverHyperLinkClass = 'ctl00_RCMMenu_13 StaticMenuHover';
document.getElementById('ctl00_ContentPlaceHolder1_ChangePassword1_ChangePasswordContainerID_VSChangePassword1').dispose = function()
{
Array.remove(Page_ValidationSummaries, document.getElementById('ctl00_ContentPlaceHolder1_ChangePassword1_ChangePasswordContainerID_VSChangePassword1'));
}
var Page_ValidationActive = false;
if (typeof(ValidatorOnLoad) == "function")
{
ValidatorOnLoad();
}
function ValidatorOnSubmit()
{
if (Page_ValidationActive)
{
return ValidatorCommonOnSubmit();
}
else
{
return true;
}
}
<pre lang="xml">To see the error image please click on below link
http://www.freeimagehosting.net/yhkfk [
http://www.freeimagehosting.net/yhkfk[^]
Regards,
VenkateshDesai.k
[edit]clickable link[/edit]
推荐答案
get(" ctl00_ToolkitScriptManager1_HiddenField").value = ' ; Sys.Application.remove_init(fn);}; Sys.Application.add_init(fn);})(); var ctl00_RCMMenu_Data = 500 ; ctl00_RCMMenu_Data.horizontalOffset = 0 ; ctl00_RCMMenu_Data.verticalOffset = 0 ; ctl00_RCMMenu_Data.hoverClass = ' ctl00_RCMMenu_16 DynamicItemHover'; ctl00_RCMMenu_Data.hoverHyperLinkClass = ' ctl00_RCMMenu_15 DynamicItemHover'; ctl00_RCMMenu_Data.staticHoverClass = ' ctl00_RCMMenu_14 StaticMenuHover'; ctl00_RCMMenu_Data.staticHoverHyperLinkClass = ' ctl00_RCMMenu_13 StaticMenuHover'; 文档 .getElementById(' ctl00_ContentPlaceHolder1_ChangePassword1_ChangePasswordContainerID_VSChangePassword1') .dispose = 功能() { 数组 .remove(Page_ValidationSummaries,文档 .getElementById(' ctl00_ContentPlaceHolder1_ChangePassword1_ChangePasswordContainerID_VSChangePassword1')); } var Page_ValidationActive = false ; 如果(类型(ValidatorOnLoad)== " 函数") { ValidatorOnLoad(); } 函数 ValidatorOnSubmit() { 如果(Page_ValidationActive) { 返回 ValidatorCommonOnSubmit(); } 其他 { 返回 真; } } < pre lang = " >要查看错误图片,请点击下面的链接
get("ctl00_ToolkitScriptManager1_HiddenField").value = '';Sys.Application.remove_init(fn);};Sys.Application.add_init(fn);})();var ctl00_RCMMenu_Data = new Object(); ctl00_RCMMenu_Data.disappearAfter = 500; ctl00_RCMMenu_Data.horizontalOffset = 0; ctl00_RCMMenu_Data.verticalOffset = 0; ctl00_RCMMenu_Data.hoverClass = 'ctl00_RCMMenu_16 DynamicItemHover'; ctl00_RCMMenu_Data.hoverHyperLinkClass = 'ctl00_RCMMenu_15 DynamicItemHover'; ctl00_RCMMenu_Data.staticHoverClass = 'ctl00_RCMMenu_14 StaticMenuHover'; ctl00_RCMMenu_Data.staticHoverHyperLinkClass = 'ctl00_RCMMenu_13 StaticMenuHover'; document.getElementById('ctl00_ContentPlaceHolder1_ChangePassword1_ChangePasswordContainerID_VSChangePassword1').dispose = function() { Array.remove(Page_ValidationSummaries, document.getElementById('ctl00_ContentPlaceHolder1_ChangePassword1_ChangePasswordContainerID_VSChangePassword1')); } var Page_ValidationActive = false; if (typeof(ValidatorOnLoad) == "function") { ValidatorOnLoad(); } function ValidatorOnSubmit() { if (Page_ValidationActive) { return ValidatorCommonOnSubmit(); } else { return true; } } <pre lang="xml">To see the error image please click on below link
http://www.freeimagehosting.net/yhkfk [
http://www.freeimagehosting.net/yhkfk[^]
Regards,
VenkateshDesai.k
[edit]clickable link[/edit]
尝试设置原始ID而非要处理的客户端ID.
try setting original id not client ID to dispose.
original ID = VSChangePassword1
client ID = ctl00_ContentPlaceHolder1_ChangePassword1_ChangePasswordContainerID_VSChangePassword1
[edit]添加了代码块[/edit]
[edit]code block added[/edit]
我是在事件"ChangePasswordPushButton"中这样写的,
ValidationSummary VSChangePassword1 =(ValidationSummary)ChangePassword1.ChangePasswordTemplateContainer.FindControl("VSChangePassword1");
VSChangePassword1.EnableClientScript = false;
VSChangePassword1.Dispose();
just i wrote like this in my event ''ChangePasswordPushButton'',
ValidationSummary VSChangePassword1 = (ValidationSummary)ChangePassword1.ChangePasswordTemplateContainer.FindControl("VSChangePassword1");
VSChangePassword1.EnableClientScript = false;
VSChangePassword1.Dispose();
这篇关于Microsoft Jscript运行时错误:无法设置属性"dispose"的值:object为null或未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!