Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8113787
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T02:56:37+00:00 2026-06-06T02:56:37+00:00

Well im trying to write my own custom control extender but i can’t get

  • 0

Well im trying to write my own custom control extender but i can’t get the javascript to work

Here you have a empty class:

Imports System.ComponentModel
Imports AjaxControlToolkit
Imports System.Web.UI
Imports System.Web.UI.WebControls


<Assembly: System.Web.UI.WebResource("GuiExtensions.PrintButtonBehavior.js", "text/javascript")> 

<Designer(GetType(PrintButtonExtenderDesigner))>
<ClientScriptResource("Sys.Extended.UI.PrintButtonExtender", "GuiExtensions.PrintButtonBehavior.js")>
<TargetControlType(GetType(IButtonControl))> _
Public Class PrintButtonExtender
    Inherits ExtenderControlBase


End Class

And here you have the javascript:

Type.registerNamespace('Sys.Extended.UI');
Sys.Extended.UI.PrintButtonExtender = function (element) {
    Sys.Extended.UI.PrintButtonExtender.initializeBase(this, [element]);
}

Sys.Extended.UI.PrintButtonExtender.prototype = {
    initialize: function () {
        Sys.Extended.UI.PrintButtonExtender.callBaseMethod(this, 'initialize');
        var element = this.get_element();
        this._clickHandler = Function.createDelegate(this, this._onClick);
        $addHandler(element, "click", this._clickHandler);
    },

    dispose: function () {

        $removeHandler(this.get_element(), "click", this._clickHandler);
        this._clickHandler = null;


        Sys.Extended.UI.PrintButtonExtender.callBaseMethod(this, 'dispose');
    },

    _onClick: function () {
        alert("Test");
        return false;
    }
}

Sys.Extended.UI.PrintButtonExtender.registerClass('Sys.Extended.UI.PrintButtonExtender', Sys.Extended.UI.BehaviorBase);

The problem here is that _onClick is never called when some one is clicking the button i assigned the extender to.. i have verified that “this.get_element();” returns the correct element but i have no luck getting the _onClick function to run.

So far i have hacked this together by looking at the source from codeplex but no success!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T02:56:38+00:00Added an answer on June 6, 2026 at 2:56 am

    change the type this._onClick

    this._clickHandler = Function.createDelegate(this, this._onClick);

    to

    this._clickHandler = Function.createDelegate(this, this._clickCallback);

    hope this will get results 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Well im trying to make my own basic Slider control just so i can
I'm trying to write a recursive function that would get some string, as well
Well I am trying to learn the java MVC pattern, but I can't understand
I'm trying to write my own functional little lib in Java. If I have
Well, I am trying to write a line of information to log in a
I am trying to figure out how well the global memory write accesses of
well iam trying to get version of IE used by user by using $.browser.version
I'm trying to write my first very own SiteMapProvider subclass. It is meant to
Been trying to write my own Prelude, and to write QuickCheck properties along with
Somewhat inexperienced programmer here trying to write a program to log into my courses

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.