Note that there are some explanatory texts on larger screens.

plurals
  1. POCalling user control JavaScript function from consuming applications JavaScript
    text
    copied!<p>I have a Web user control named UserControl.ascx and a JavaScript function 'GetValues()' to return some value is embedded in that ascx page. I've compiled the ascx page into a dll and used that in another web application.But now the problem is when I tried to call the user control JavaScript function from web application, JS Debugger showing 'GetValues' is undefined error. Is there any way solve this issue ?</p> <p>in ASCX File:</p> <pre><code>&lt;%@ Control Language="C#" AutoEventWireup="true" CodeFile="ICEImage.ascx.cs" Inherits="ICEImage" %&gt; &lt;div&gt; &lt;asp:TextBox ID="txtValue" runat="server" BackColor="#FFFFC0" ReadOnly="True" Width="150px" &lt;/div&gt; &lt;script type="text/javascript"&gt; function GetValue() { return parseInt(document.getElementById('&lt;%=txtValue.ClientID%&gt;').value); } &lt;/script&gt; </code></pre> <p>ASPX File:</p> <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %&gt; &lt;%@ Register TagPrefix="ASP" Assembly="App_Web_iceimage.ascx.cdcab7d2" Namespace="ASP" %&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml" &gt; &lt;head runat="server"&gt; &lt;title&gt;Sample Page&lt;/title&gt; &lt;/head&gt; &lt;body style="background-color: #383838"&gt; &lt;form id="form1" runat="server"&gt; &lt;ASP:iceimage_ascx ID="ICEImage1" runat="server"&gt;&lt;/ASP:iceimage_ascx&gt; &lt;button id="btnSave" style="width: 85px; height: 29px" type="button" onclick="GetValue()"&gt;Save&lt;/button&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload