| | |
Script raises Page error when accessing HTML control
Please support our ASP.NET advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Jun 2007
Posts: 22
Reputation:
Solved Threads: 5
The following script function "btnRunScript_onclick" works as long as it does not access the HTML control "txtMessage". If it does, "Page Error" is shown in the statusbar of Internet Explorer (6). Knows anybody why? Thank you.
ASP.NET Syntax (Toggle Plain Text)
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="GuessingGame.aspx.vb" Inherits="Ch07Le04.GuessingGame"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <title>GuessingGame</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 id="clientEventHandlersJS" language="javascript"> function btnRunScript_onclick() { sMessage = "ABC"; /* document.write("<h2>ABC</h2>"); */ /* works */ txtMessage.value = sMessage; /* raises Page Error */ } </script> </HEAD> <body language="javascript"> <form id="Form1" method="post" runat="server"> <h2>The Guessing Game - Responding to Events with Script Procedures</h2> <hr> <P> <INPUT id="btnRunScript" type="button" value="Run Script" language="javascript" onclick="return btnRunScript_onclick()"> </P> <P><INPUT id="txtMessage" type="text" value="ABC" name="txtMessage"></P> </form> </body> </HTML>
•
•
Join Date: Jun 2007
Posts: 22
Reputation:
Solved Threads: 5
I solved the problem meanwhile. I replaced
by
ASP.NET Syntax (Toggle Plain Text)
txtMessage.value = sMessage; /* raises Page Error */
ASP.NET Syntax (Toggle Plain Text)
window.Form1.txtMessage.value = sMessage; /* works */
Last edited by dadelsen; Jun 13th, 2008 at 12:51 pm.
![]() |
Other Threads in the ASP.NET Forum
- Previous Thread: Gis
- Next Thread: Is there a way?
Views: 1050 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for ASP.NET
.net 2.0 3.5 ajax alltypeofvideos appliances application asp asp.net beginner box browser businesslogiclayer button c# cac checkbox class complex control countryselector dataaccesslayer database datagrid datagridview datalist deployment development dgv dialog dropdownmenu dynamic dynamically edit editing embeddingactivexcontrol feedback fileuploader fill findcontrol flash folder form gridview gudi identity iis image javascript languages list listbox maps mobile mouse mssql nameisnotdeclared news novell numerical opera parent problem profile radio redirect registration relationaldatabases reportemail response.redirect richtextbox rows schoolproject search security select services sessionvariables silverlight smoobjects software sql sql-server ssl theft tracking treeview validatedate validation vb.net videos vista visualstudio vs2008 web webapplications webdevelopment webprogramming wizard xsl





