I am attempting to develop a customized AJAX user control that includes a client-side object as well. Despite following the guidelines provided in this resource: https://msdn.microsoft.com/en-us/library/bb398906.aspx, I am encountering persistent issues.
The problem arises with "element" consistently being undefined within my constructor. Below is the entirety of my JS file:
Type.registerNamespace("UserControls");
/**
* The stock window user control class.
* @param {element} element - The stock window element.
*/
UserControls.StockWindow = function(element)
{
UserControls.StockWindow.initializeBase(this, [element]);
};
UserControls.StockWindow.registerClass("UserControls.StockWindow", Sys.UI.Control);
Here is a snippet from my ASPX file for reference:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="StockWindow.ascx.cs" Inherits="StockPicker.UserControls.StockWindow"%>
<%@ Register tagprefix="custom" src="~/UserControls/ModalWindow.ascx" tagname="ModalWindow" %>
<div id="<%= ID %>">
<%-- Initially hide the modal window. --%>
<div id="ModalWindowContainer" style="display: none;" runat="server">
<custom:ModalWindow ID="ModalWindowForStock" runat="server" />
</div>
</div>
This section contains an excerpt from my ASPX.CS file:
using System;
using System.Collections.Generic;
using System.Web.UI;
using System.Web.Services;
namespace StockPicker.UserControls
{
/// <summary>
/// A class dedicated to managing pop-up windows related to stocks.
/// </summary>
public partial class StockWindow : UserControl, IScriptControl
{
// Additional logic and methods here...
}
}