Click here to Skip to main content
12,821,315 members (40,471 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# ASP.NET
Hi All,

I am Using Validation Summary like
<asp:ValidationSummary ID="VSChangePassword1" runat ="server" ShowMessageBox ="true" ShowSummary ="false"  
ValidationGroup ="VGChangePassword1" DisplayMode="List" />

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">


(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") 

function ValidatorOnSubmit() 
if (Page_ValidationActive)

  return ValidatorCommonOnSubmit();
return true; 
<pre lang="xml">To see the error image please click on below link[^]


[edit]clickable link[/edit]
Posted 12-Nov-12 1:53am
Updated 12-Nov-12 5:34am
digimanus 12-Nov-12 10:01am
you use getElementById, but sometimes you need getElementsByName to find the object in your page.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

try setting original id not client ID to dispose.

original ID  = VSChangePassword1
client ID = ctl00_ContentPlaceHolder1_ChangePassword1_ChangePasswordContainerID_VSChangePassword1

[edit]code block added[/edit]
Venki Desai 14-Nov-12 0:51am
Actually i doesn't wrote any Dispose() method in my page.
This ID 'ctl00_ContentPlaceHolder1_ChangePassword1_ChangePasswordContainerID_VSChangePassword1'
is coming dynamically for Validation Summary ID.
I am giving originally for Validation Summary ID as 'VSChangePassword1'.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

just i wrote like this in my event 'ChangePasswordPushButton',
ValidationSummary VSChangePassword1 = (ValidationSummary)ChangePassword1.ChangePasswordTemplateContainer.FindControl("VSChangePassword1");
VSChangePassword1.EnableClientScript = false;

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170308.1 | Last Updated 14 Nov 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100