Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 309
  • Last Modified:

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

0
jwoodhams
Asked:
jwoodhams
  • 3
  • 2
1 Solution
 
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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
 
jwoodhamsAuthor Commented:
Thanks so much.  It is always those simple oversights that make me crazy.
Thanks again.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now