Detailsview works in testing, not in production

Hi everyone, I am building a website for my church and everything works fine in testing however, when I upload to the server I get this error: System.Web.UI.WebControls.DataControlFieldCollection must have items of type 'System.Web.UI.WebControls.DataControlField'. 'HeaderStyle' is of type 'System.Web.UI.HtmlControls.HtmlGenericControl'.

I have no idea what to do with this because like I said, it works fine in testing.  Anyone have anythoughts?  Code is below: It is failing on line 7. Some issues with the Header Style tag.
<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" CssClass="Details" 
                            DataSourceID="SqlDataSource2" EnableModelValidation="True">
            <Fields>
                <asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" 
                    ReadOnly="True" SortExpression="id" />
                <asp:TemplateField HeaderText="Date SortExpression="dtDate">
                    <HeaderStyle VerticalAlign="Top" />
                    <EditItemTemplate>
                        <asp:TextBox runat="server" ID="txtDate" Text='<%#Bind("dtDate") %>' Width="150px"></asp:TextBox>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox runat="server" ID="txtDate" Text='<%#Bind("dtDate") %>' Width="150px"></asp:TextBox>
                    </InsertItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText="Title" SortExpression="chrTitle">
                    <EditItemTemplate>
                        <asp:TextBox runat="server" ID="txtTitle" Text='<%#Bind("chrTitle") %>' Width="150px"></asp:TextBox>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox runat="server" ID="txtTitle" Text='<%#Bind("chrTitle") %>' Width="150px"></asp:TextBox>
                    </InsertItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText="Description" SortExpression="chrDescription">
                    <HeaderStyle VerticalAlign="Top" />
                    <EditItemTemplate>
                        <asp:TextBox runat="server" ID="txtDescription" Text='<%#Bind("chrDescription") %>' TextMode="MultiLine" Width="550px" Height="200px"></asp:TextBox>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox runat="server" ID="txtDescription" Text='<%#Bind("chrDescription") %>' TextMode="MultiLine" Width="550px" Height="200px"></asp:TextBox>
                    </InsertItemTemplate>
                </asp:TemplateField>
                <asp:CommandField ShowEditButton="True" />
            </Fields>
         </asp:DetailsView>

Open in new window

LVL 1
jwoodhamsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

HainKurtSr. System AnalystCommented:
make sure your web app using right .net framework on server (IIS settings for your application) and make sure correct .net framework installed on prod web server
0
jwoodhamsAuthor Commented:
Using IIS V6.0 and asp.net 4.0.30319.
0
HainKurtSr. System AnalystCommented:
what happens if you remove these lines

<HeaderStyle VerticalAlign="Top" />
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

jwoodhamsAuthor Commented:
The crash happens on the next line down if I remove the <HeaderStyle VerticalAlign="Top"/>
0
CtrlAltDlCommented:
Your HeaderText from line 6 is missing a quote:
 <asp:TemplateField HeaderText="Date SortExpression="dtDate">

Should be:
 <asp:TemplateField HeaderText="Date" SortExpression="dtDate">
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jwoodhamsAuthor Commented:
Thanks so much.  It is always those simple oversights that make me crazy.
Thanks again.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.