NNTP-Posting-Date: Wed, 19 Nov 2003 19:04:49 EST
Path: cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP08
.phx.gbl!newsfeed00.sul.t-online.de!t-online.de!tiscali!newsfeed1.ip.tiscali
.net!newshosting.com!news-xfer1.atl.newshosting.com!167.206.3.103.MISMATCH!n
ews3.optonline.net!news.primus.ca!news.primus.ca!newsfeed.mountaincable.net!
cyclone01.bloor.is.net.cable.rogers.com!news04.bloor.is.net.cable.rogers.com
.POSTED!not-for-mail
Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.framework.aspnet:191447
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
Ok, I can reproduce this at will.
Steps to reproduce:
1. Copy button WButton , select it , CTL-C
2. Paste as new button , CTL-V
3. Run app, and voila
The original code and code after the IDE changed it follows after the error.
Sorry about the size but this is the only way to give you the details
needed.
The error produced when running the app is:
Control 'Button1' of type 'Button' must be placed inside a form tag with
runat=server.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.Web.HttpException: Control 'Button1' of type
'Button' must be placed inside a form tag with runat=server.
Source Error:
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.
Stack Trace:
[HttpException (0x80004005): Control 'Button1' of type 'Button' must be
placed inside a form tag with runat=server.]
System.Web.UI.Page.VerifyRenderingInServerForm(Control control)
System.Web.UI.WebControls.Button.AddAttributesToRender(HtmlTextWriter
writer)
System.Web.UI.WebControls.WebControl.RenderBeginTag(HtmlTextWriter
writer)
System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer)
System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
System.Web.UI.Control.Render(HtmlTextWriter writer)
System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
System.Web.UI.Page.ProcessRequestMain()
Orignal HTML:
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm2.aspx.vb"
Inherits="RemoteSongs.WebForm2"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>WebForm2</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="
http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema">
<script language="javascript" id="clientEventHandlersJS">
<!--
function SwitchSong(pl)
{
//debugger
document.MediaPlayer1.Stop();
var i = pl.selectedIndex
var opts = pl.options
var fName;
fName="Songs/" + opts
.value;
document.MediaPlayer1.FileName=fName;
DIV1.innerText=fName;
document.MediaPlayer1.Play();
}
function SaveVolumeF()
{
//debugger
var ctl;
ctl=document.getElementById("hidVolume")
ctl.value=document.MediaPlayer1.Volume;
//alert(ctl.innerText);
}
function RestoreVolume()
{
//debugger
var ctl;
ctl=document.getElementById("hidVolume")
document.MediaPlayer1.Volume=ctl.value;
var i;
i=1;
}
//-->
</script>
</HEAD>
<body bgColor="#cc9933" MS_POSITIONING="GridLayout">
<p style="FONT-SIZE: large" align="center">Lloyd's Free Radio</p>
<form id="Form1" method="post" runat="server">
<asp:button id="Button19" style="Z-INDEX: 128; LEFT: 569px; POSITION:
absolute; TOP: 60px" runat="server"
Width="26px" Height="20px" Text="1-9" ToolTip="Click to See List of
Songs beginning with letter"></asp:button><asp:button id="CButton"
style="Z-INDEX: 104; LEFT: 70px; POSITION: absolute; TOP: 60px"
runat="server"
Width="20px" Height="20px" Text="C" ToolTip="Click to See List of Songs
beginning with letter"></asp:button><asp:button id="VButton" style="Z-INDEX:
117; LEFT: 488px; POSITION: absolute; TOP: 60px" runat="server"
Width="20px" Height="20px" Text="V" ToolTip="Click to See List of Songs
beginning with letter"></asp:button><asp:button id="EButton" style="Z-INDEX:
109; LEFT: 114px; POSITION: absolute; TOP: 60px" runat="server"
Width="20px" Height="20px" Text="E" ToolTip="Click to See List of Songs
beginning with letter"></asp:button><asp:button id="GButton" style="Z-INDEX:
107; LEFT: 158px; POSITION: absolute; TOP: 60px" runat="server"
Width="20px" Height="20px" Text="G" ToolTip="Click to See List of Songs
beginning with letter"></asp:button><asp:button id="RButton" style="Z-INDEX:
115; LEFT: 400px; POSITION: absolute; TOP: 60px" runat="server"
Width="20px" Height="20px" Text="R" ToolTip="Click to See List of Songs
beginning with letter"></asp:button><asp:button id="KButton" style="Z-INDEX:
110; LEFT: 246px; POSITION: absolute; TOP: 60px" runat="server"
Width="20px" Height="20px" Text="K" ToolTip="Click to See List of Songs
beginning with letter"></asp:button><asp:button id="MButton" style="Z-INDEX:
105; LEFT: 290px; POSITION: absolute; TOP: 60px" runat="server"
Width="20px" Height="20px" Text="M" ToolTip="Click to See List of Songs
beginning with letter"></asp:button><asp:button id="OButton" style="Z-INDEX:
121; LEFT: 334px; POSITION: absolute; TOP: 60px" runat="server"
Width="20px" Height="20px" Text="O" ToolTip="Click to See List of Songs
beginning with letter"></asp:button><asp:button id="HButton" style="Z-INDEX:
114; LEFT: 180px; POSITION: absolute; TOP: 60px" runat="server"
Width="20px" Height="20px" Text="H" ToolTip="Click to See List of Songs
beginning with letter"></asp:button><asp:button id="UButton" style="Z-INDEX:
124; LEFT: 466px; POSITION: absolute; TOP: 60px" runat="server"
Width="20px" Height="20px" Text="U" ToolTip="Click to See List of Songs
beginning with letter"></asp:button><asp:button id="QButton" style="Z-INDEX:
120; LEFT: 378px; POSITION: absolute; TOP: 60px" runat="server"
Width="20px" Height="20px" Text="Q" ToolTip="Click to See List of Songs
beginning with letter"></asp:button><asp:button id="WButton" style="Z-INDEX:
118; LEFT: 510px; POSITION: absolute; TOP: 60px" runat="server"
Width="20px" Height="20px" Text="W" ToolTip="Click to See List of Songs
beginning with letter"></asp:button><asp:button id="SButton" style="Z-INDEX:
116; LEFT: 422px; POSITION: absolute; TOP: 60px" runat="server"
Width="20px" Height="20px" Text="S" ToolTip="Click to See List of Songs
beginning with letter"></asp:button><asp:button id="NButton" style="Z-INDEX:
122; LEFT: 312px; POSITION: absolute; TOP: 60px" runat="server"
Width="20px" Height="20px" Text="N" ToolTip="Click to See List of Songs
beginning with letter"></asp:button><asp:button id="XYZButton"
style="Z-INDEX: 123; LEFT: 532px; POSITION: absolute; TOP: 60px"
runat="server" Width="33px" Height="20px" Text="XYZ" ToolTip="Click to
See List of Songs beginning with letter"></asp:button><asp:button
id="DButton" style="Z-INDEX: 111; LEFT: 92px; POSITION: absolute; TOP: 60px"
runat="server"
Width="20px" Height="20px" Text="D" ToolTip="Click to See List of Songs
beginning with letter"></asp:button><asp:button id="FButton" style="Z-INDEX:
108; LEFT: 136px; POSITION: absolute; TOP: 60px" runat="server"
Width="20px" Height="20px" Text="F" ToolTip="Click to See List of Songs
beginning with letter"></asp:button><asp:button id="TButton" style="Z-INDEX:
125; LEFT: 444px; POSITION: absolute; TOP: 60px" runat="server"
Width="20px" Height="20px" Text="T" ToolTip="Click to See List of Songs
beginning with letter"></asp:button><asp:button id="JButton" style="Z-INDEX:
112; LEFT: 224px; POSITION: absolute; TOP: 60px" runat="server"
Width="20px" Height="20px" Text="J" ToolTip="Click to See List of Songs
beginning with letter"></asp:button><asp:button id="LButton" style="Z-INDEX:
106; LEFT: 268px; POSITION: absolute; TOP: 60px" runat="server"
Width="20px" Height="20px" Text="L" ToolTip="Click to See List of Songs
beginning with letter"></asp:button><asp:button id="PButton" style="Z-INDEX:
119; LEFT: 356px; POSITION: absolute; TOP: 60px" runat="server"
Width="20px" Height="20px" Text="P" ToolTip="Click to See List of Songs
beginning with letter"></asp:button><asp:button id="IButton" style="Z-INDEX:
113; LEFT: 202px; POSITION: absolute; TOP: 60px" runat="server"
Width="20px" Height="20px" Text="I" ToolTip="Click to See List of Songs
beginning with letter"></asp:button><asp:button id="BButton" style="Z-INDEX:
103; LEFT: 48px; POSITION: absolute; TOP: 60px" runat="server"
Width="20px" Height="20px" Text="B" ToolTip="Click to See List of Songs
beginning with letter"></asp:button><asp:button id="AButton" style="Z-INDEX:
102; LEFT: 26px; POSITION: absolute; TOP: 60px" runat="server"
Width="20px" Height="20px" Text="A" ToolTip="Click to See List of Songs
beginning with letter"></asp:button><asp:listbox id="ListBox1"
style="Z-INDEX: 126; LEFT: 24px; POSITION: absolute; TOP: 86px"
runat="server"
Width="397px" Height="521px"></asp:listbox>
<div id="DIV1" style="Z-INDEX: 127; LEFT: 432px; WIDTH: 485px; POSITION:
absolute; TOP: 337px; HEIGHT: 19px"
runat="server" Width="82px" Height="53px">Panel</div>
<!-- BEGIN GENERIC ALL BROWSER FRIENDLY HTML FOR WINDOWS MEDIA PLAYER -->
<OBJECT id="MediaPlayer1" style="Z-INDEX: 101; LEFT: 431px; WIDTH: 296px;
POSITION: absolute; TOP: 362px; HEIGHT: 46px"
codeBase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf