Robert Francis
asked on
Manually adjusting asp.net code gives parser error
I am trying to learn asp.net after creating a bunch of pages using asp 3.0. To do this I am using Visual Studio Express 2013 for web, dragging tables to create grid views, and then looking at the code in hopes of better understanding so I can eventually hand code.
So I use the gridview tasks > edit columns and change the item style to give a column a specific width. That works. I then go to the code and manually do the same thing for another column. When I run it in my browser I get this:
Server Error in '/portal2' Application.
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: System.Web.UI.WebControls. DataContro lFieldColl ection must have items of type 'System.Web.UI.WebControls .DataContr olField'. 'ItemStyle' is of type 'System.Web.UI.HtmlControl s.HtmlGene ricControl '.
Source Error:
Line 29: <asp:BoundField DataField="assigned" HeaderText="Assigned To" SortExpression="assigned" />
Line 30: <asp:BoundField DataField="customer" HeaderText="Customer" SortExpression="customer" />
Line 31: <asp:BoundField DataField="jobno" HeaderText="Job No" SortExpression="jobno" /><ItemStyle Width="100px" /></asp:BoundField>
Line 32: <asp:BoundField DataField="duedate" HeaderText="Due Date" SortExpression="duedate" DataFormatString="{0:d}" ><ItemStyle Width="100px" /></asp:BoundField>
Line 33: <asp:BoundField DataField="issue" HeaderText="Issue" SortExpression="issue" />
Source File: /portal2/issues.aspx Line: 31
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34237
This makes no sense. If I start using VS.net am I forced to use all the stupid little wizards and not hand code at all?
So I use the gridview tasks > edit columns and change the item style to give a column a specific width. That works. I then go to the code and manually do the same thing for another column. When I run it in my browser I get this:
Server Error in '/portal2' Application.
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: System.Web.UI.WebControls.
Source Error:
Line 29: <asp:BoundField DataField="assigned" HeaderText="Assigned To" SortExpression="assigned" />
Line 30: <asp:BoundField DataField="customer" HeaderText="Customer" SortExpression="customer" />
Line 31: <asp:BoundField DataField="jobno" HeaderText="Job No" SortExpression="jobno" /><ItemStyle Width="100px" /></asp:BoundField>
Line 32: <asp:BoundField DataField="duedate" HeaderText="Due Date" SortExpression="duedate" DataFormatString="{0:d}" ><ItemStyle Width="100px" /></asp:BoundField>
Line 33: <asp:BoundField DataField="issue" HeaderText="Issue" SortExpression="issue" />
Source File: /portal2/issues.aspx Line: 31
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34237
This makes no sense. If I start using VS.net am I forced to use all the stupid little wizards and not hand code at all?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER