M
moondaddy
I'm running winXP and vb.net 1.1: I want some JavaScript to add a value to
a textbox server control in a web user control. The below code works in an
aspx page, but on in an ascx page. can anyone please advise?
Thanks in advance!
<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="zzTestTextBox.aspx.vb" Inherits="CharmPix.zzTestTextBox"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>zzTestTextBox</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
<script type="text/javascript">
function TestFuncInUC(){
alert('TestFuncInUC')
//txtID.value='123' //this didnt work in the UC either.
var txt;
txt = document.getElementById("txtID");
txt.value='123';
}
</script>
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<INPUT style="Z-INDEX: 101; LEFT: 48px; WIDTH: 130px; POSITION: absolute;
TOP: 34px; HEIGHT: 44px"
type="button" value="Button" onclick="TestFuncInUC()">
<asp:textbox id="txtID" runat="server"></asp:textbox>
</form>
</body>
</HTML>
a textbox server control in a web user control. The below code works in an
aspx page, but on in an ascx page. can anyone please advise?
Thanks in advance!
<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="zzTestTextBox.aspx.vb" Inherits="CharmPix.zzTestTextBox"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>zzTestTextBox</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
<script type="text/javascript">
function TestFuncInUC(){
alert('TestFuncInUC')
//txtID.value='123' //this didnt work in the UC either.
var txt;
txt = document.getElementById("txtID");
txt.value='123';
}
</script>
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<INPUT style="Z-INDEX: 101; LEFT: 48px; WIDTH: 130px; POSITION: absolute;
TOP: 34px; HEIGHT: 44px"
type="button" value="Button" onclick="TestFuncInUC()">
<asp:textbox id="txtID" runat="server"></asp:textbox>
</form>
</body>
</HTML>