473,396 Members | 1,683 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

'GridView' must be placed inside a form tag with runat=server

Hi,
I've an asp.net .ascx form and a gridview on that form.I've placed that form on an .aspx. Now while I'm trying to import data from gridview to excel it is showing the error "Control 'GridView' must be placed inside a form tag with runat=server"

I've overrides the ascx as follow :

Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)
MyBase.Render(writer)
End Sub

But still it is shwoing the same error.
Could anyone help me please.
Sep 13 '08 #1
5 10576
sivabe
3
Check your html code..
whether the form tag occured or not....
in the form tag you have add runat =server
Sep 13 '08 #2
Check your html code..
whether the form tag occured or not....
in the form tag you have add runat =server
Yes it is there as below :
<form id="form1" runat="server">
Sep 14 '08 #3
Plater
7,872 Expert 4TB
Yes it is there as below :
<form id="form1" runat="server">
And your GridView tag occurs between the <form> and </form> tags and ALSO has the runat="server" attribute?
Sep 15 '08 #4
And your GridView tag occurs between the <form> and </form> tags and ALSO has the runat="server" attribute?

Yes.See the code below :

<form id="form1" runat="server">
<div>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
<img src="Images/Title.jpg" unselectable="on" /></td>
<td style="width: 3px">
</td>
</tr>
<tr>
<td>
<uc1:WrongCode ID="WrongCode1" runat="server" />
</td>
<td style="width: 3px">
</td>
</tr>
</table>

</div>
</form>
Sep 16 '08 #5
Plater
7,872 Expert 4TB
Well I don't see a gridview, I see a custom control.
It would look like the troubles are withen the custom control somewhere then?
Sep 16 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Gary Bagen | last post by:
Hello, I am working on a page transition scheme and was wondering what the quickest way is to find out which ASP.NET controls need to be inside a form with runat=server. I've determined that...
4
by: Matthew Louden | last post by:
It happend to me more than once. When I create web controls or move the positions in VS.NET, I encountered the following run-time errors: It doesn't matter what controls I create, the following...
2
by: trinitypete | last post by:
Hi all, I have searched this error but none of the posts seem to reflect my situation. I have a base aspx page that all other pages inherit from. I know than none of the HTML is inherited only...
7
by: Tom wilson | last post by:
I'm trying to create dynamic controls in ASP.Net. It's driving me nuts. I keep getting the error: Control '16' of type 'RadioButton' must be placed inside a form tag with runat=server. Dim...
2
by: Sen Mathew via .NET 247 | last post by:
Dear all I also have problem with Datagrid Complaining'DataGridLinkButton' must be placed inside a form tag withrunat=server. But My file is an ascx file ie it is a usercontrol. I call this file...
3
by: Russ | last post by:
I have a usercontrol that is loaded by a webform. The usercontrol populates a datagrid which users need the capability to export data from the grid to Excel. The problem is that when I attempt to...
0
by: davidr | last post by:
Hi, I have a panel that I load user Control in no problem. The problem arrises when I do a post back on one of these user controls. I have button it does a click event. In this click event I...
1
by: waihung.wee | last post by:
Hi I got the following error in my xxx.cs file (code behind file) According to the error message, I should add a form tag in the file. But form tag should not appear in a code behind file ...
2
by: André | last post by:
Hi, i get sometimes an very unexpected error: "A form tag with runat=server must exist on the Page to use SetFocus() or the Focus property" at line: If j = 1 Then txta(i).Focus() There is a...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.