Here is my Code
protected void Page_Load(System.Object sender, System.EventArgs e)
{
try
{
if (!Page.IsPostBack)
{
if (((string)Settings["template"] != null) && ((string)Settings["template"] != ""))
strTemplate = (string)Settings["template"];
else
strTemplate = Localization.GetString("Template.Text", LocalResourceFile);
testController objtests = new testController();
if (ClientAPI.BrowserSupportsFunctionality(ClientAPI.ClientFunctionality.XMLHTTP) && ClientAPI.BrowserSupportsFunctionality(ClientAPI.ClientFunctionality.XML))
{
ClientAPI.RegisterClientReference(this.Page, ClientAPI.ClientNamespaceReferences.dnn_xml);
ClientAPI.RegisterClientReference(this.Page, ClientAPI.ClientNamespaceReferences.dnn_xmlhttp);
}
this.Button1.Attributes.Add("onclick", ClientAPI.GetCallbackEventReference(this, "dnn.dom.getById('" + testLBL.ClientID + "').value", "successFunc", "'" + Button1.ClientID + "'", "errorFunc"));
if (this.Page.IsClientScriptBlockRegistered("helloajax.js") == false)
this.Page.RegisterClientScriptBlock("ajax.js",
"<script language=\"javascript\" src=" + "\"" + this.ModulePath + "ajax.js" + "\"></script>");
}
}
catch (Exception exc) //Module failed to load
{
Exceptions.ProcessModuleLoadException(this, exc);
}
}
public string RaiseClientAPICallbackEvent(string eventArgument)
{
return "HELLO: " + eventArgument;
}
<%@ Control language="C#" Inherits="YourCompany.Modules.test.Viewtest" CodeFile="Viewtest.ascx.cs" AutoEventWireup="true"%>
<%@ Register TagPrefix="dnn" TagName="Audit" Src="~/controls/ModuleAuditControl.ascx" %>
<asp:Label ID="testLBL" runat="server" Text="This is a Test Label"></asp:Label>
<br>
<input id="Button1" type="button" value="button" name="Button1" runat="server"/><br>