Click here to Skip to main content
Rate this: bad
good
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">
 
//<![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 12-Nov-12 0:53am
Edited 12-Nov-12 4:34am
Nelek47.5K
v4
Comments
digimanus at 12-Nov-12 10:01am
   
you use getElementById, but sometimes you need getElementsByName to find the object in your page.
Rate this: bad
good
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]
  Permalink  
v2
Comments
Venki Desai at 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
good
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;
VSChangePassword1.Dispose();
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 7,280
1 Sergey Alexandrovich Kryukov 6,059
2 Maciej Los 3,579
3 Peter Leow 3,383
4 CHill60 2,522


Advertise | Privacy | Mobile
Web01 | 2.8.140721.1 | Last Updated 14 Nov 2012
Copyright © CodeProject, 1999-2014
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