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 ?
in ASCX File:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ICEImage.ascx.cs" Inherits="ICEImage" %>
<div>
<asp:TextBox ID="txtValue" runat="server" BackColor="#FFFFC0" ReadOnly="True" Width="150px"
</div>
<script type="text/javascript">
function GetValue()
{
return parseInt(document.getElementById('<%=txtValue.ClientID%>').value);
}
</script>
ASPX File:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register TagPrefix="ASP" Assembly="App_Web_iceimage.ascx.cdcab7d2" Namespace="ASP" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Sample Page</title>
</head>
<body style="background-color: #383838">
<form id="form1" runat="server">
<ASP:iceimage_ascx ID="ICEImage1" runat="server"></ASP:iceimage_ascx>
<button id="btnSave" style="width: 85px; height: 29px" type="button" onclick="GetValue()">Save</button>
</form>
</body>
</html>