Add Extension Method in UserControl aspx in Javascript

348 views Asked by At

this is my user control and i want to add an extension method in javascript to validate the controls inside my usercontrol but it seems not working. any help would be appreciated.

namespace A.B.UserControls
{
    public partial class C: System.Web.UI.UserControl
    {

    }
}

this is my javascript

A.B.UserControls.C.prototype =
    {            
         ValidateControls : function() {
             alert("hi");
         }
    };

this is my error

ReferenceError: "A" is not defined

A.B.UserControls.C.prototype =

this is the content of my .aspx file

<%@ Control 
    Language="C#" 
    AutoEventWireup="true" 
    CodeBehind="C.ascx.cs" 
    Inherits="A.B.UserControls.C" %>


<div style="width: 100%; height: auto; padding: 10px;" class="">
    <h1>Charge To</h1>
    <br />


</div>


<telerik:RadCodeBlock runat="server">
    <script>

        EM.View.UserControls.ChargeToBrowser.prototype =
        {            
            ValidateControls : function() {
                alert("hi");
            }
        };
    </script>
</telerik:RadCodeBlock>
1

There are 1 answers

2
Eng-Mohamed Abdulwahab On

User control Not mapped as User Control it mapped as Html tags [Span] and if u give me details more I can help u.

main keys Override Render Event in user control and u can manage all things