Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Error In Control Emplemented "ICallbackEventHandler"

Error In Control Emplemented "ICallbackEventHandler"

Scheduled Pinned Locked Moved ASP.NET
javascripthelpdesign
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    alireza_s_84
    wrote on last edited by
    #1

    i created a validator control was inherited "BaseValidator" and implemented "ICallbackEventHandler" it's work well in normal page but generated problem when i create a MasterPage and use this control in page that use MasterPage. the error message is : "The target 'ctl00_ContentPlaceHolder1_ExistFieldValidator1' for the callback could not be found or did not implement ICallbackEventHandler" My vb code is: Imports System Imports System.Collections.Generic Imports System.ComponentModel Imports System.Text Imports System.Web Imports System.Web.UI Imports System.Web.UI.WebControls <Assembly: WebResource("JScript.js", "application/x-javascript")> Namespace Softcam Public Class ExistFieldValidator Inherits BaseValidator Implements ICallbackEventHandler Public Event ServerValidate As ServerValidateEventHandler Dim _ControlToValidateValue As String Protected Overrides Function EvaluateIsValid() As Boolean Dim ctlToValidate As String = Me.GetControlValidationValue(Me.ControlToValidate) Return ExecuteValidationValue(ctlToValidate) End Function Protected Overrides Sub OnPreRender(ByVal e As System.EventArgs) Dim EventRef As String = Page.ClientScript.GetCallbackEventReference(Me, "", "", "") If Me.EnableClientScript Then Page.ClientScript.RegisterClientScriptResource(Me.GetType(), "JScript.js") End If MyBase.OnPreRender(e) End Sub Protected Overrides Sub RegisterValidatorDeclaration() MyBase.RegisterValidatorDeclaration() Me.Page.ClientScript.RegisterExpandoAttribute(Me.ClientID, "evaluationfunction", "FieldExistValidate") End Sub Protected Overrides Function DetermineRenderUplevel() As Boolean Return Context.Request.Browser.SupportsCallback End Function Public Function GetCallbackResult() As String Implements System.Web.UI.ICallbackEventHandler.GetCallbackResult Return ExecuteValidationValue(_ControlToValidateValue).ToString() End Function Public Sub RaiseCallbackEvent(ByVal eventArgument As String) Implements System.Web.UI.ICallbackEventHandler.RaiseCallbackEvent _ControlToValidateValue = eventArgument End Sub Private Function ExecuteValidationValue(ByVal ctlValidation As

    M 1 Reply Last reply
    0
    • A alireza_s_84

      i created a validator control was inherited "BaseValidator" and implemented "ICallbackEventHandler" it's work well in normal page but generated problem when i create a MasterPage and use this control in page that use MasterPage. the error message is : "The target 'ctl00_ContentPlaceHolder1_ExistFieldValidator1' for the callback could not be found or did not implement ICallbackEventHandler" My vb code is: Imports System Imports System.Collections.Generic Imports System.ComponentModel Imports System.Text Imports System.Web Imports System.Web.UI Imports System.Web.UI.WebControls <Assembly: WebResource("JScript.js", "application/x-javascript")> Namespace Softcam Public Class ExistFieldValidator Inherits BaseValidator Implements ICallbackEventHandler Public Event ServerValidate As ServerValidateEventHandler Dim _ControlToValidateValue As String Protected Overrides Function EvaluateIsValid() As Boolean Dim ctlToValidate As String = Me.GetControlValidationValue(Me.ControlToValidate) Return ExecuteValidationValue(ctlToValidate) End Function Protected Overrides Sub OnPreRender(ByVal e As System.EventArgs) Dim EventRef As String = Page.ClientScript.GetCallbackEventReference(Me, "", "", "") If Me.EnableClientScript Then Page.ClientScript.RegisterClientScriptResource(Me.GetType(), "JScript.js") End If MyBase.OnPreRender(e) End Sub Protected Overrides Sub RegisterValidatorDeclaration() MyBase.RegisterValidatorDeclaration() Me.Page.ClientScript.RegisterExpandoAttribute(Me.ClientID, "evaluationfunction", "FieldExistValidate") End Sub Protected Overrides Function DetermineRenderUplevel() As Boolean Return Context.Request.Browser.SupportsCallback End Function Public Function GetCallbackResult() As String Implements System.Web.UI.ICallbackEventHandler.GetCallbackResult Return ExecuteValidationValue(_ControlToValidateValue).ToString() End Function Public Sub RaiseCallbackEvent(ByVal eventArgument As String) Implements System.Web.UI.ICallbackEventHandler.RaiseCallbackEvent _ControlToValidateValue = eventArgument End Sub Private Function ExecuteValidationValue(ByVal ctlValidation As

      M Offline
      M Offline
      majee
      wrote on last edited by
      #2

      You please check the ClientID of that control on the master page. It may be different on master page and content pages.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups