don't understand error

M

m miller

..NET 2003, Win XP and Win 2000 Pro, IE 6.0 SP1

I have a webform with a button, an html input a dropdown list and a data
grid. Users may use the drop down to choose a part number which then
posts back to the input and populates the grid.

In testing I can choose about 20 or 30 part numbers and all works well.
Then, all of a sudden, I get an app error:

Control 'dgOnHand__ctl1_ctl1' of type 'DataGridLinkButton' must be placed
inside a form tag with runat=server

I don't have a DataGridLinkButton, nor can I find any references to one.

I'm really curious as to what this is all about.

Thanks,
m miller
 
A

Alvin Bruney

open your aspx page in html view. you will find that the control it is
complaining about appears after the closing form tag </form>
just move it inside the closing form tag and that should fix the problem for
you. it's a vs bug in the way vs rewrites a dirty aspx page.
 
P

Philip Rieck

if your datagrid has a <asp:ButtonColumn type="LinkButton"> in it, then the
datagrid is generating a DataGridLinkButton for you.

Most likely, this is due to the VS bug that places items outside a </form>
tag sometimes.

Open up your aspx file for this page in design view (not code view)
Click the "HTML" button just below the page, if "Design" is currently
selected.
Find your </form> tag, and make sure that it is AFTER all controls on your
page (it should probably have only </body></html> after it)

Now try your app.
 
S

Steven Cheng[MSFT]

Hi m miller,


Thank you for using Microsoft newsgroup Service. Based on your description,
when you run a page with some button, dropdownlist and DataGrid controls,
you encountered a error like:
Control 'dgOnHand__ctl1_ctl1' of type 'DataGridLinkButton' must be placed
inside a form tag with runat=server

As for this problem, I agree to Alvin and Philip 's suggestions. This is
most likely caused by some control element is put outside the <form ...
runat=server> 's </form> tag. You may have a check in the page's html
source as Alvin or Philip suggested. If you need any further assistant,
please feel free to post here.



Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
Joined
Sep 8, 2006
Messages
4
Reaction score
0
I am facing the same problem but the form tag in design mode is just fine.

Please help
 

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,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top