HTML Designer Problems

L

Lloyd Sheen

This IDE is driving me nuts. I needed another button so I copied an
existing one, changed the Text and the id and position by drag and drop.
Well then I run and get the following:

Control 'Button19' of type 'Button' must be placed inside a form tag with
runat=server

Can the IDE not do what it is supposed to do. It seems that it is a fight
to make it do anything or did I do something wrong? It would seem silly to
have to create a new button every time when there are buttons with
attributes that can be copied????

Help Please
 
J

Jim Cheshire [MSFT]

Lloyd,

This usually happens when you take an HTML page and rename it to .aspx.
When you create a Webform in VS.NET, it adds a <form> tag with a "runat"
attribute and a value of "server". If you don't have that, you'll get this
error.

The solution is to add a <form> tag to the page. The best place to add it
is directly under the opening <body> tag. You will then put the closing
</form> tag right before the closing </body> tag. For example:

<body>
<form name="form1" runat="server">
... page content here ...
</form>
</body>

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
(e-mail address removed)

This post is provided as-is with no warranties and confers no rights.

--------------------
From: "Lloyd Sheen" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.aspnet
Subject: HTML Designer Problems
Lines: 15
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID:
Date: Wed, 19 Nov 2003 03:32:14 GMT
NNTP-Posting-Host: 24.157.22.156
X-Complaints-To: (e-mail address removed)
X-Trace: twister01.bloor.is.net.cable.rogers.com 1069212734 24.157.22.156
(Tue, 18 Nov 2003 22:32:14 EST)
 
L

Lloyd Sheen

I can see that would be a problem but this is not what happened in my case.
I had an array (my term) of buttons corresponding to each first letter of
the alphabet. I was using the caption on the button as an index to get
information. Now the information for xyz is found in one source so I
combined 3 buttons into one and added through a copy a new button for
numeric items with caption 1-9.

When I copied the button it placed it at the top left corner. When I moved
(drag and drop) the button the problem was created. The IDE for HTML is
certainly not as rigorous in the design mode. I have had so many problems
it would take a book to enumerate them.

Another problem is in the following:
Create a control.
Give it an ID
Delete the control
Create a new one
Give it same name as deleted control
This generally give an invalid option dialog (I suppose for the id since
that is what I change in the properties dialog).

If I get out of IDE and get back in I can add the control with the old name
no problem. Perhaps MS has implemented the (if the car does not work get
out and then back in and try again) solution.


Jim Cheshire said:
Lloyd,

This usually happens when you take an HTML page and rename it to .aspx.
When you create a Webform in VS.NET, it adds a <form> tag with a "runat"
attribute and a value of "server". If you don't have that, you'll get this
error.

The solution is to add a <form> tag to the page. The best place to add it
is directly under the opening <body> tag. You will then put the closing
</form> tag right before the closing </body> tag. For example:

<body>
<form name="form1" runat="server">
... page content here ...
</form>
</body>

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
(e-mail address removed)

This post is provided as-is with no warranties and confers no rights.

--------------------
From: "Lloyd Sheen" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.aspnet
Subject: HTML Designer Problems
Lines: 15
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID:
Date: Wed, 19 Nov 2003 03:32:14 GMT
NNTP-Posting-Host: 24.157.22.156
X-Complaints-To: (e-mail address removed)
X-Trace: twister01.bloor.is.net.cable.rogers.com 1069212734 24.157.22.156
(Tue, 18 Nov 2003 22:32:14 EST)
NNTP-Posting-Date: Tue, 18 Nov 2003 22:32:14 EST
Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-online.de!newsfeed.freenet.de!newsfeed.tiscali.ch!solnet.ch!solnet.ch!newsfeed.mountaincable.net!cyclone01.bloor.is.net.cable.rogers.com!twister01.bloor.is.n
et.cable.rogers.com.POSTED!not-for-mail
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:191872
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet

This IDE is driving me nuts. I needed another button so I copied an
existing one, changed the Text and the id and position by drag and drop.
Well then I run and get the following:

Control 'Button19' of type 'Button' must be placed inside a form tag with
runat=server

Can the IDE not do what it is supposed to do. It seems that it is a fight
to make it do anything or did I do something wrong? It would seem silly to
have to create a new button every time when there are buttons with
attributes that can be copied????

Help Please
 
B

Bill Priess

The reason this works (or doesn't work, in this case) is because of how the
IDE does code/design separation and how the IDE fires events internally.
Here is a simple workaround:

A. Add a button to a webform.
B. Give it an ID.
C. Position it.
D. Here's the kicker... switch to HTML View and then back to design view.
Look at your code-behind and you will see that the control has been created
in code.
E. Switch back to Design View and delete the button.
F. Add a new button and try to give it the same id as the one that was
deleted.
G. Oops! Got an error message? Ok,
G1. Switch again from Design View to HTML View after you have deleted
the button. Look in your code behind and you will see that
the button declaration has disappeared!
G2. Now, switch back to Design View and readd the button with the same
id as the one that was deleted and you should get no
error message. :)

The reason this happens is that the IDE fires an event when you drag a
control onto a web form and in that event, it first checks to see if there
is already a control declared with this id. If there is none, it declares
the control in the code behind. Now, when you delete a button from the
designer and that event misfires for whatever reason, the control
declaration does not get removed, and exactly as it says, you cannot have
two controls with the same id. When switching between design view and html
view, the IDE again fires another event and double checks that all the
controls have been declared. This is reported to be fixed in Whidbey.

HTH,
Bill P.


Lloyd Sheen said:
I can see that would be a problem but this is not what happened in my case.
I had an array (my term) of buttons corresponding to each first letter of
the alphabet. I was using the caption on the button as an index to get
information. Now the information for xyz is found in one source so I
combined 3 buttons into one and added through a copy a new button for
numeric items with caption 1-9.

When I copied the button it placed it at the top left corner. When I moved
(drag and drop) the button the problem was created. The IDE for HTML is
certainly not as rigorous in the design mode. I have had so many problems
it would take a book to enumerate them.

Another problem is in the following:
Create a control.
Give it an ID
Delete the control
Create a new one
Give it same name as deleted control
This generally give an invalid option dialog (I suppose for the id since
that is what I change in the properties dialog).

If I get out of IDE and get back in I can add the control with the old name
no problem. Perhaps MS has implemented the (if the car does not work get
out and then back in and try again) solution.


Jim Cheshire said:
Lloyd,

This usually happens when you take an HTML page and rename it to .aspx.
When you create a Webform in VS.NET, it adds a <form> tag with a "runat"
attribute and a value of "server". If you don't have that, you'll get this
error.

The solution is to add a <form> tag to the page. The best place to add it
is directly under the opening <body> tag. You will then put the closing
</form> tag right before the closing </body> tag. For example:

<body>
<form name="form1" runat="server">
... page content here ...
</form>
</body>

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
(e-mail address removed)

This post is provided as-is with no warranties and confers no rights.

--------------------
From: "Lloyd Sheen" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.aspnet
Subject: HTML Designer Problems
Lines: 15
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID:
Date: Wed, 19 Nov 2003 03:32:14 GMT
NNTP-Posting-Host: 24.157.22.156
X-Complaints-To: (e-mail address removed)
X-Trace: twister01.bloor.is.net.cable.rogers.com 1069212734
24.157.22.156
(Tue, 18 Nov 2003 22:32:14 EST)
NNTP-Posting-Date: Tue, 18 Nov 2003 22:32:14 EST
Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-online.de!newsfeed.freenet.de!newsfeed.tiscali.ch!solnet.ch!solnet.ch!newsfeed.mountaincable.net!cyclone01.bloor.is.net.cable.rogers.com!twister01.bloor.is.n silly
 
L

Lloyd Sheen

All I can say is WOW. I am sure there is a good reason for this but it
eludes for now. At least I have a workaround.

Thanks.

Bill Priess said:
The reason this works (or doesn't work, in this case) is because of how the
IDE does code/design separation and how the IDE fires events internally.
Here is a simple workaround:

A. Add a button to a webform.
B. Give it an ID.
C. Position it.
D. Here's the kicker... switch to HTML View and then back to design view.
Look at your code-behind and you will see that the control has been created
in code.
E. Switch back to Design View and delete the button.
F. Add a new button and try to give it the same id as the one that was
deleted.
G. Oops! Got an error message? Ok,
G1. Switch again from Design View to HTML View after you have deleted
the button. Look in your code behind and you will see that
the button declaration has disappeared!
G2. Now, switch back to Design View and readd the button with the same
id as the one that was deleted and you should get no
error message. :)

The reason this happens is that the IDE fires an event when you drag a
control onto a web form and in that event, it first checks to see if there
is already a control declared with this id. If there is none, it declares
the control in the code behind. Now, when you delete a button from the
designer and that event misfires for whatever reason, the control
declaration does not get removed, and exactly as it says, you cannot have
two controls with the same id. When switching between design view and html
view, the IDE again fires another event and double checks that all the
controls have been declared. This is reported to be fixed in Whidbey.

HTH,
Bill P.


I can see that would be a problem but this is not what happened in my case.
I had an array (my term) of buttons corresponding to each first letter of
the alphabet. I was using the caption on the button as an index to get
information. Now the information for xyz is found in one source so I
combined 3 buttons into one and added through a copy a new button for
numeric items with caption 1-9.

When I copied the button it placed it at the top left corner. When I moved
(drag and drop) the button the problem was created. The IDE for HTML is
certainly not as rigorous in the design mode. I have had so many problems
it would take a book to enumerate them.

Another problem is in the following:
Create a control.
Give it an ID
Delete the control
Create a new one
Give it same name as deleted control
This generally give an invalid option dialog (I suppose for the id since
that is what I change in the properties dialog).

If I get out of IDE and get back in I can add the control with the old name
no problem. Perhaps MS has implemented the (if the car does not work get
out and then back in and try again) solution.
add
it
is directly under the opening <body> tag. You will then put the closing
</form> tag right before the closing </body> tag. For example:

<body>
<form name="form1" runat="server">
... page content here ...
</form>
</body>

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
(e-mail address removed)

This post is provided as-is with no warranties and confers no rights.

--------------------
From: "Lloyd Sheen" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.aspnet
Subject: HTML Designer Problems
Lines: 15
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID:
<[email protected]>
Date: Wed, 19 Nov 2003 03:32:14 GMT
NNTP-Posting-Host: 24.157.22.156
X-Complaints-To: (e-mail address removed)
X-Trace: twister01.bloor.is.net.cable.rogers.com 1069212734 24.157.22.156
(Tue, 18 Nov 2003 22:32:14 EST)
NNTP-Posting-Date: Tue, 18 Nov 2003 22:32:14 EST
Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-online.de!newsfeed.freenet.de!newsfeed.tiscali.ch!solnet.ch!solnet.ch!newsfeed.mountaincable.net!cyclone01.bloor.is.net.cable.rogers.com!twister01.bloor.is.n
 
J

Jim Cheshire [MSFT]

Bill,

It is true that the architecture is completely different in Whidbey.
However, I am unable to reproduce this behavior that you and Lloyd are
reporting. I have also searched our bug databases and see no information
on a bug that was fixed in Everett. Can you give me specific repro steps?

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
(e-mail address removed)

This post is provided as-is with no warranties and confers no rights.


--------------------
From: "Bill Priess" <[email protected]>
References:
<[email protected]>
Subject: Re: HTML Designer Problems
Date: Wed, 19 Nov 2003 09:47:58 -0800
Lines: 153
Organization: eCircle Software, LLC
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.aspnet
NNTP-Posting-Host: 65.115.95.253
Path: cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP08
.phx.gbl!TK2MSFTNGP12.phx.gbl
Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.framework.aspnet:191306
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet

The reason this works (or doesn't work, in this case) is because of how the
IDE does code/design separation and how the IDE fires events internally.
Here is a simple workaround:

A. Add a button to a webform.
B. Give it an ID.
C. Position it.
D. Here's the kicker... switch to HTML View and then back to design view.
Look at your code-behind and you will see that the control has been created
in code.
E. Switch back to Design View and delete the button.
F. Add a new button and try to give it the same id as the one that was
deleted.
G. Oops! Got an error message? Ok,
G1. Switch again from Design View to HTML View after you have deleted
the button. Look in your code behind and you will see that
the button declaration has disappeared!
G2. Now, switch back to Design View and readd the button with the same
id as the one that was deleted and you should get no
error message. :)

The reason this happens is that the IDE fires an event when you drag a
control onto a web form and in that event, it first checks to see if there
is already a control declared with this id. If there is none, it declares
the control in the code behind. Now, when you delete a button from the
designer and that event misfires for whatever reason, the control
declaration does not get removed, and exactly as it says, you cannot have
two controls with the same id. When switching between design view and html
view, the IDE again fires another event and double checks that all the
controls have been declared. This is reported to be fixed in Whidbey.

HTH,
Bill P.


I can see that would be a problem but this is not what happened in my case.
I had an array (my term) of buttons corresponding to each first letter of
the alphabet. I was using the caption on the button as an index to get
information. Now the information for xyz is found in one source so I
combined 3 buttons into one and added through a copy a new button for
numeric items with caption 1-9.

When I copied the button it placed it at the top left corner. When I moved
(drag and drop) the button the problem was created. The IDE for HTML is
certainly not as rigorous in the design mode. I have had so many problems
it would take a book to enumerate them.

Another problem is in the following:
Create a control.
Give it an ID
Delete the control
Create a new one
Give it same name as deleted control
This generally give an invalid option dialog (I suppose for the id since
that is what I change in the properties dialog).

If I get out of IDE and get back in I can add the control with the old name
no problem. Perhaps MS has implemented the (if the car does not work get
out and then back in and try again) solution.


Jim Cheshire said:
Lloyd,

This usually happens when you take an HTML page and rename it to .aspx.
When you create a Webform in VS.NET, it adds a <form> tag with a "runat"
attribute and a value of "server". If you don't have that, you'll get this
error.

The solution is to add a <form> tag to the page. The best place to add it
is directly under the opening <body> tag. You will then put the closing
</form> tag right before the closing </body> tag. For example:

<body>
<form name="form1" runat="server">
... page content here ...
</form>
</body>

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
(e-mail address removed)

This post is provided as-is with no warranties and confers no rights.

--------------------
From: "Lloyd Sheen" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.aspnet
Subject: HTML Designer Problems
Lines: 15
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID:
<[email protected]>
Date: Wed, 19 Nov 2003 03:32:14 GMT
NNTP-Posting-Host: 24.157.22.156
X-Complaints-To: (e-mail address removed)
X-Trace: twister01.bloor.is.net.cable.rogers.com 1069212734 24.157.22.156
(Tue, 18 Nov 2003 22:32:14 EST)
NNTP-Posting-Date: Tue, 18 Nov 2003 22:32:14 EST
Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onli ne.de!newsfeed.freenet.de!newsfeed.tiscali.ch!solnet.ch!solnet.ch!newsfeed.m ountaincable.net!cyclone01.bloor.is.net.cable.rogers.com!twister01.bloor.is. n
et.cable.rogers.com.POSTED!not-for-mail
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:191872
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet

This IDE is driving me nuts. I needed another button so I copied an
existing one, changed the Text and the id and position by drag and drop.
Well then I run and get the following:

Control 'Button19' of type 'Button' must be placed inside a form tag with
runat=server

Can the IDE not do what it is supposed to do. It seems that it is a fight
to make it do anything or did I do something wrong? It would seem
silly
to
have to create a new button every time when there are buttons with
attributes that can be copied????

Help Please
 
L

Lloyd Sheen

These are the steps to reproduce.

I can see that would be a problem but this is not what happened in my case.
I had an array (my term) of buttons corresponding to each first letter of
the alphabet. I was using the caption on the button as an index to get
information. Now the information for xyz is found in one source so I
combined 3 buttons into one and added through a copy a new button for
numeric items with caption 1-9.

When I copied the button it placed it at the top left corner. When I moved
(drag and drop) the button the problem was created. The IDE for HTML is
certainly not as rigorous in the design mode. I have had so many problems
it would take a book to enumerate them.

Another problem is in the following:
Create a control.
Give it an ID
Delete the control
Create a new one
Give it same name as deleted control
This generally give an invalid option dialog (I suppose for the id since
that is what I change in the properties dialog).

If I get out of IDE and get back in I can add the control with the old name
no problem. Perhaps MS has implemented the (if the car does not work get
out and then back in and try again) solution.
 
J

Jim Cheshire [MSFT]

Lloyd,

This is the same post you made previously. I am unable to reproduce this
using these steps.

What version of Visual Studio .NET are you using?

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
(e-mail address removed)

This post is provided as-is with no warranties and confers no rights.


--------------------
From: "Lloyd Sheen" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.aspnet
References:
<[email protected]>
<[email protected]>
<[email protected]>
Subject: Re: HTML Designer Problems
Lines: 30
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <6GQub.4558$J%[email protected]>
Date: Wed, 19 Nov 2003 20:48:02 GMT
NNTP-Posting-Host: 24.157.22.156
X-Complaints-To: (e-mail address removed)
X-Trace: twister01.bloor.is.net.cable.rogers.com 1069274882 24.157.22.156
(Wed, 19 Nov 2003 15:48:02 EST)
 
L

Lloyd Sheen

VS 2003


Jim Cheshire said:
Lloyd,

This is the same post you made previously. I am unable to reproduce this
using these steps.

What version of Visual Studio .NET are you using?

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
(e-mail address removed)

This post is provided as-is with no warranties and confers no rights.


--------------------
From: "Lloyd Sheen" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.aspnet
References:
<[email protected]>
<[email protected]>
<[email protected]>
Subject: Re: HTML Designer Problems
Lines: 30
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <6GQub.4558$J%[email protected]>
Date: Wed, 19 Nov 2003 20:48:02 GMT
NNTP-Posting-Host: 24.157.22.156
X-Complaints-To: (e-mail address removed)
X-Trace: twister01.bloor.is.net.cable.rogers.com 1069274882 24.157.22.156
(Wed, 19 Nov 2003 15:48:02 EST)
NNTP-Posting-Date: Wed, 19 Nov 2003 15:48:02 EST
Path:
cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP08phx.gbl!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!eusc.inter.net!priapus.visi.com!news-out.visi.com!petbe.visi.com!news-out1.nntp.be!propagator2-sterling!news-in-sterling.newsfeed.com!news-in-sterling.nuthinbutnews.com!newsfeed.mountaincable.net!cyclone01.bloor.is.net.cable.roge
rs.com!twister01.bloor.is.net.cable.rogers.com.POSTED!not-for-mail
Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.framework.aspnet:191379
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet

These are the steps to reproduce.

I can see that would be a problem but this is not what happened in my case.
I had an array (my term) of buttons corresponding to each first letter of
the alphabet. I was using the caption on the button as an index to get
information. Now the information for xyz is found in one source so I
combined 3 buttons into one and added through a copy a new button for
numeric items with caption 1-9.

When I copied the button it placed it at the top left corner. When I moved
(drag and drop) the button the problem was created. The IDE for HTML is
certainly not as rigorous in the design mode. I have had so many problems
it would take a book to enumerate them.

Another problem is in the following:
Create a control.
Give it an ID
Delete the control
Create a new one
Give it same name as deleted control
This generally give an invalid option dialog (I suppose for the id since
that is what I change in the properties dialog).

If I get out of IDE and get back in I can add the control with the old name
no problem. Perhaps MS has implemented the (if the car does not work get
out and then back in and try again) solution.
 
J

Jim Cheshire [MSFT]

I'm not sure what to tell you, Lloyd. I tried reproducing this on Visual
Studio .NET 2003, and it does not reproduce for me. If you can give me
steps to reliably reproduce this problem, I can look into it. Otherwise,
there's not much I can do.

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
(e-mail address removed)

This post is provided as-is with no warranties and confers no rights.


--------------------
From: "Lloyd Sheen" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.aspnet
References:
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
Subject: Re: HTML Designer Problems
Lines: 96
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <[email protected]>
Date: Wed, 19 Nov 2003 23:16:51 GMT
NNTP-Posting-Host: 24.157.22.156
X-Complaints-To: (e-mail address removed)
X-Trace: news04.bloor.is.net.cable.rogers.com 1069283811 24.157.22.156
(Wed, 19 Nov 2003 18:16:51 EST)
NNTP-Posting-Date: Wed, 19 Nov 2003 18:16:51 EST
Path: cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP08
.phx.gbl!newsfeed00.sul.t-online.de!t-online.de!peernews3.colt.net!news0.de.
colt.net!news-fra1.dfn.de!npeer.de.kpn-eurorings.net!newsfeed.news2me.com!ne
wsfeed.mountaincable.net!cyclone01.bloor.is.net.cable.rogers.com!news04.bloo
r.is.net.cable.rogers.com.POSTED!not-for-mail
Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.framework.aspnet:191435
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet

VS 2003


Jim Cheshire said:
Lloyd,

This is the same post you made previously. I am unable to reproduce this
using these steps.

What version of Visual Studio .NET are you using?

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
(e-mail address removed)

This post is provided as-is with no warranties and confers no rights.


--------------------
From: "Lloyd Sheen" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.aspnet
References:
<[email protected]>
<[email protected]>
<[email protected]>
Subject: Re: HTML Designer Problems
Lines: 30
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID:
Date: Wed, 19 Nov 2003 20:48:02 GMT
NNTP-Posting-Host: 24.157.22.156
X-Complaints-To: (e-mail address removed)
X-Trace: twister01.bloor.is.net.cable.rogers.com 1069274882
24.157.22.156
(Wed, 19 Nov 2003 15:48:02 EST)
NNTP-Posting-Date: Wed, 19 Nov 2003 15:48:02 EST
Path:
cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP0 8phx.gbl!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!eusc.inter.net!priapus.visi.com!news-out.visi.com!petbe.visi.com!news-out1.n ntp.be!propagator2-sterling!news-in-sterling.newsfeed.com!news-in-sterling.n uthinbutnews.com!newsfeed.mountaincable.net!cyclone01.bloor.is.net.cable.rog e
rs.com!twister01.bloor.is.net.cable.rogers.com.POSTED!not-for-mail
Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.framework.aspnet:191379
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet

These are the steps to reproduce.

I can see that would be a problem but this is not what happened in my case.
I had an array (my term) of buttons corresponding to each first letter of
the alphabet. I was using the caption on the button as an index to get
information. Now the information for xyz is found in one source so I
combined 3 buttons into one and added through a copy a new button for
numeric items with caption 1-9.

When I copied the button it placed it at the top left corner. When I moved
(drag and drop) the button the problem was created. The IDE for HTML is
certainly not as rigorous in the design mode. I have had so many problems
it would take a book to enumerate them.

Another problem is in the following:
Create a control.
Give it an ID
Delete the control
Create a new one
Give it same name as deleted control
This generally give an invalid option dialog (I suppose for the id since
that is what I change in the properties dialog).

If I get out of IDE and get back in I can add the control with the old name
no problem. Perhaps MS has implemented the (if the car does not work get
out and then back in and try again) solution.
 
L

Lloyd Sheen

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.
cab#Version=5,1,52,701"
type="application/x-oleobject" standby="Loading Microsoft® Windows®
Media Player components..."
clasid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95">
<EMBED type="application/x-mplayer2"
pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/Me
diaPlayer/"
SRC="" name="MediaPlayer1" width="160" height="135"
ShowStatusBar="true" ShowControls="false">
</EMBED>
</OBJECT>
<asp:Button id="SearchButton" style="Z-INDEX: 129; LEFT: 436px; POSITION:
absolute; TOP: 92px"
runat="server" Text="Search All" Height="21px"
Width="91px"></asp:Button>
<asp:TextBox id="SearchItems" style="Z-INDEX: 130; LEFT: 535px; POSITION:
absolute; TOP: 89px"
runat="server" Height="22px" Width="262px"></asp:TextBox>
<!-- END GENERIC ALL BROWSER FRIENDLY HTML FOR WINDOWS MEDIA
PLAYER --></form>
</body>
</HTML>



Modified HTML (by IDE)

<%@ 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">
<asp:button id="Button1" style="Z-INDEX: 131; LEFT: 520px; POSITION:
absolute; TOP: 160px" runat="server"
ToolTip="Click to See List of Songs beginning with letter" Text="XYZ"
Height="20px" Width="33px"></asp:button>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: 103; 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:
116; 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:
108; 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:
106; 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:
114; 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:
109; 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:
104; 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:
120; 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:
113; 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:
119; 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:
117; 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:
115; 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:
121; 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: 110; 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:
107; 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:
111; 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:
105; 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:
118; 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:
112; 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:
102; 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:
101; 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: 100; LEFT: 431px; WIDTH: 296px;
POSITION: absolute; TOP: 362px; HEIGHT: 46px"

codeBase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.
cab#Version=5,1,52,701"
type="application/x-oleobject" standby="Loading Microsoft® Windows®
Media Player components..."
classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95">
<EMBED type="application/x-mplayer2"
pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/Me
diaPlayer/"
SRC="" name="MediaPlayer1" width="160" height="135"
ShowStatusBar="true" ShowControls="false">
</EMBED>
</OBJECT>
<asp:Button id="SearchButton" style="Z-INDEX: 129; LEFT: 436px; POSITION:
absolute; TOP: 92px"
runat="server" Text="Search All" Height="21px"
Width="91px"></asp:Button>
<asp:TextBox id="SearchItems" style="Z-INDEX: 130; LEFT: 535px; POSITION:
absolute; TOP: 89px"
runat="server" Height="22px" Width="262px"></asp:TextBox>
<!-- END GENERIC ALL BROWSER FRIENDLY HTML FOR WINDOWS MEDIA
PLAYER --></form>
</body>
</HTML>
 
L

Lloyd Sheen

Ps. After creating the new button I dragged it to an unused portion of the
form. Switching between Design and HTML view does not help.

Lloyd
 
J

Jim Cheshire [MSFT]

Lloyd,

I tried reproducing this again this morning. No luck. It works fine for
me as it should. The first button is called Button1 and when you copy and
paste it, the new button is named Button2. Both of them are within the
<form> tag and the application runs fine.

Can you reproduce this on a new Webform created by VS.NET?

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
(e-mail address removed)

This post is provided as-is with no warranties and confers no rights.

--------------------
From: "Lloyd Sheen" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.aspnet
References:
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<6GQub.4558$J%[email protected]>
<[email protected]>
Subject: Re: HTML Designer Problems
Lines: 387
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <[email protected]>
Date: Thu, 20 Nov 2003 00:04:49 GMT
NNTP-Posting-Host: 24.157.22.156
X-Complaints-To: (e-mail address removed)
X-Trace: news04.bloor.is.net.cable.rogers.com 1069286689 24.157.22.156
(Wed, 19 Nov 2003 19:04:49 EST)
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
 
B

Bill Priess

Strange... I get the same behavior when I do it, but it is inconsistent. It
doesn't happen if I use LinkButton, but I do get it if I create a button or
an custom control that inherits from button. If I drag a button on to a web
form, it is given a unique id. Now, if I delete an existing button and try
to give the new button the same id as the one I deleted, I get an error
message with that nifty little error box (what were the UI designers at MS
smoking when they came up with that error box? lol)...

I'm just waiting for Whidbey.. ;)

Bill P.
 
L

Lloyd Sheen

Jim,

I just added a logon screen to the app and had exactly the same problem.
This time all I did was add a textbox. I have noticed that for some reason
when I click the TextBox in the ToolBox and try to draw it on the form
surface there are some areas where the cursor changes so that I cannot
perform this operation.

If you want to see what happens check my email (there is spam hindering in
the address. Perhaps I can show you using NetMeeting.

LLoyd Sheen


Jim Cheshire said:
Lloyd,

I tried reproducing this again this morning. No luck. It works fine for
me as it should. The first button is called Button1 and when you copy and
paste it, the new button is named Button2. Both of them are within the
<form> tag and the application runs fine.

Can you reproduce this on a new Webform created by VS.NET?

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
(e-mail address removed)

This post is provided as-is with no warranties and confers no rights.

--------------------
From: "Lloyd Sheen" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.aspnet
References:
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<6GQub.4558$J%[email protected]>
<[email protected]>
Subject: Re: HTML Designer Problems
Lines: 387
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <[email protected]>
Date: Thu, 20 Nov 2003 00:04:49 GMT
NNTP-Posting-Host: 24.157.22.156
X-Complaints-To: (e-mail address removed)
X-Trace: news04.bloor.is.net.cable.rogers.com 1069286689 24.157.22.156
(Wed, 19 Nov 2003 19:04:49 EST)
NNTP-Posting-Date: Wed, 19 Nov 2003 19:04:49 EST
Path:
cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP08phx.gbl!newsfeed00.sul.t-online.de!t-online.de!tiscali!newsfeed1.ip.tiscalinet!newshosting.com!news-xfer1.atl.newshosting.com!167.206.3.103.MISMATCH!news3.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
 
L

Lloyd Sheen

PS. Once the form goes wrong it cannot be fixed. Every thing I add after
the problem is placed after the form. This causes the problem I am
describing. Just in case this might help the version is 7.1.3088.

Lloyd Sheen


Jim Cheshire said:
Lloyd,

I tried reproducing this again this morning. No luck. It works fine for
me as it should. The first button is called Button1 and when you copy and
paste it, the new button is named Button2. Both of them are within the
<form> tag and the application runs fine.

Can you reproduce this on a new Webform created by VS.NET?

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
(e-mail address removed)

This post is provided as-is with no warranties and confers no rights.

--------------------
From: "Lloyd Sheen" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.aspnet
References:
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<6GQub.4558$J%[email protected]>
<[email protected]>
Subject: Re: HTML Designer Problems
Lines: 387
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <[email protected]>
Date: Thu, 20 Nov 2003 00:04:49 GMT
NNTP-Posting-Host: 24.157.22.156
X-Complaints-To: (e-mail address removed)
X-Trace: news04.bloor.is.net.cable.rogers.com 1069286689 24.157.22.156
(Wed, 19 Nov 2003 19:04:49 EST)
NNTP-Posting-Date: Wed, 19 Nov 2003 19:04:49 EST
Path:
cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP08phx.gbl!newsfeed00.sul.t-online.de!t-online.de!tiscali!newsfeed1.ip.tiscalinet!newshosting.com!news-xfer1.atl.newshosting.com!167.206.3.103.MISMATCH!news3.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
 
L

Lloyd Sheen

Ok, I think I have the problem identified.

I have a heading for the page which somehow ended up preceeding the form (I
would think this is ok).
As soon as this element is present the IDE will not allow controls to be
dropped in the area at the top of the screen. The element that caused the
problem looks as follows:

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="intro.aspx.vb"
Inherits="RemoteSongs.intro"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>intro</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">
</HEAD>
<body MS_POSITIONING="GridLayout" bgColor="peru">
<p style="FONT-SIZE: large" align="center">Page Heading to be fixed
later</p>
<form id="Form1" method="post" runat="server">
</form>
</body>
</HTML>

It is the <p that causes the problem. Remove this and no problem. This tag
was entered by copying the tag from other pages.

Lloyd Sheen

Jim Cheshire said:
Lloyd,

I tried reproducing this again this morning. No luck. It works fine for
me as it should. The first button is called Button1 and when you copy and
paste it, the new button is named Button2. Both of them are within the
<form> tag and the application runs fine.

Can you reproduce this on a new Webform created by VS.NET?

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
(e-mail address removed)

This post is provided as-is with no warranties and confers no rights.

--------------------
From: "Lloyd Sheen" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.aspnet
References:
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<6GQub.4558$J%[email protected]>
<[email protected]>
Subject: Re: HTML Designer Problems
Lines: 387
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <[email protected]>
Date: Thu, 20 Nov 2003 00:04:49 GMT
NNTP-Posting-Host: 24.157.22.156
X-Complaints-To: (e-mail address removed)
X-Trace: news04.bloor.is.net.cable.rogers.com 1069286689 24.157.22.156
(Wed, 19 Nov 2003 19:04:49 EST)
NNTP-Posting-Date: Wed, 19 Nov 2003 19:04:49 EST
Path:
cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP08phx.gbl!newsfeed00.sul.t-online.de!t-online.de!tiscali!newsfeed1.ip.tiscalinet!newshosting.com!news-xfer1.atl.newshosting.com!167.206.3.103.MISMATCH!news3.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
 
J

Jim Cheshire [MSFT]

Hi Lloyd,

That makes sense. The <form> tag will be added after the opening <body>
tag.

It's possible that this wouldn't have happened using FlowLayout, but I
haven't tested it. In any case, it's always best to make sure that
everything in the page body is surrounded by the <form> tag.

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
(e-mail address removed)

This post is provided as-is with no warranties and confers no rights.


--------------------
From: "Lloyd Sheen" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.aspnet
References:
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<6GQub.4558$J%[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
Subject: Re: HTML Designer Problems
Lines: 338
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <[email protected]>
Date: Fri, 21 Nov 2003 00:26:14 GMT
NNTP-Posting-Host: 24.157.22.156
X-Complaints-To: (e-mail address removed)
X-Trace: news04.bloor.is.net.cable.rogers.com 1069374374 24.157.22.156
(Thu, 20 Nov 2003 19:26:14 EST)
NNTP-Posting-Date: Thu, 20 Nov 2003 19:26:14 EST
Path: cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP08
phx.gbl!newsfeed00.sul.t-online.de!t-online.de!130.59.10.21.MISMATCH!irazu.
switch.ch!switch.ch!news.hispeed.ch!news-out.cwix.com!newsfeed.cwix.com!cycl
one01.bloor.is.net.cable.rogers.com!news04.bloor.is.net.cable.rogers.com.POS
TED!not-for-mail
Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.framework.aspnet:191737
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet

Ok, I think I have the problem identified.

I have a heading for the page which somehow ended up preceeding the form (I
would think this is ok).
As soon as this element is present the IDE will not allow controls to be
dropped in the area at the top of the screen. The element that caused the
problem looks as follows:

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="intro.aspx.vb"
Inherits="RemoteSongs.intro"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>intro</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">
</HEAD>
<body MS_POSITIONING="GridLayout" bgColor="peru">
<p style="FONT-SIZE: large" align="center">Page Heading to be fixed
later</p>
<form id="Form1" method="post" runat="server">
</form>
</body>
</HTML>

It is the <p that causes the problem. Remove this and no problem. This tag
was entered by copying the tag from other pages.

Lloyd Sheen

Jim Cheshire said:
Lloyd,

I tried reproducing this again this morning. No luck. It works fine for
me as it should. The first button is called Button1 and when you copy and
paste it, the new button is named Button2. Both of them are within the
<form> tag and the application runs fine.

Can you reproduce this on a new Webform created by VS.NET?

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
(e-mail address removed)

This post is provided as-is with no warranties and confers no rights.

--------------------
From: "Lloyd Sheen" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.aspnet
References:
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<6GQub.4558$J%[email protected]>
<[email protected]>
Subject: Re: HTML Designer Problems
Lines: 387
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <[email protected]>
Date: Thu, 20 Nov 2003 00:04:49 GMT
NNTP-Posting-Host: 24.157.22.156
X-Complaints-To: (e-mail address removed)
X-Trace: news04.bloor.is.net.cable.rogers.com 1069286689 24.157.22.156
(Wed, 19 Nov 2003 19:04:49 EST)
NNTP-Posting-Date: Wed, 19 Nov 2003 19:04:49 EST
Path:
cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP0 8phx.gbl!newsfeed00.sul.t-online.de!t-online.de!tiscali!newsfeed1.ip.tiscalinet!newshosting.com!news-xfer1.atl.newshosting.com!167.206.3.103.MISMATCH!news3.optonline.net!news.primus.ca!news.primus.ca!newsfeed.mountaincable.net !cyclone01.bloor.is.net.cable.rogers.com!news04.bloor.is.net.cable.rogers.co m
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/nsmp2in

f
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top