Click here to Skip to main content
15,893,161 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I am Using Validation Summary like
ASP.NET
<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
HTML
<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[^]


Regards,
VenkateshDesai.k

[edit]clickable link[/edit]
Posted
Updated 12-Nov-12 4:34am
v4
Comments
Herman<T>.Instance 12-Nov-12 10:01am    
you use getElementById, but sometimes you need getElementsByName to find the object in your page.

try setting original id not client ID to dispose.

C#
original ID  = VSChangePassword1
client ID = ctl00_ContentPlaceHolder1_ChangePassword1_ChangePasswordContainerID_VSChangePassword1


[edit]code block added[/edit]
 
Share this answer
 
v2
Comments
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'.
just i wrote like this in my event 'ChangePasswordPushButton',
ValidationSummary VSChangePassword1 = (ValidationSummary)ChangePassword1.ChangePasswordTemplateContainer.FindControl("VSChangePassword1");
VSChangePassword1.EnableClientScript = false;
VSChangePassword1.Dispose();
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900