gpt4 book ai didi

asp.net - FormView 不显示

转载 作者:行者123 更新时间:2023-12-04 17:11:39 25 4
gpt4 key购买 nike

我一整天都在想办法解决这个问题 - 我有一个 FormView带有一些文本字段和 GridView有几列。出于某种原因,我的 FormView不显示,但 GridView
我的 .aspx 文件如下:
FormView :

<asp:FormView ID="frmPurchases" runat="server" DataKeyNames="ID"  DataSourceID="dsPurchases" DataMember="DefaultView" Width="100%" SkinID="formSkinPP" >
<ItemTemplate>
<asp:Label id="lblApproval" runat="server" Text="NOT APPROVED: the guids do not match...."></asp:Label>
<br /><br />
<div style="width:800px;padding:0px 0px 10px 0px;">
<div style="float:left;width:400px;">
<div style="float:left;width:100px;">Reference</div>
<div style="float:left;">
<asp:TextBox ID="txtReference" CssClass="TextBox" runat="server" Width="237px" ValidationGroup="Group1" Text='<%# Bind("SupplierReference") %>'></asp:TextBox><br />
</div>
</div>


<div style="width:800px;padding:0px 0px 10px 0px;">
<div style="float:left;width:400px;">
<div style="float:left;width:100px;">Date</div>
<div style="float:left;">
<telerik:RadDatePicker DatePopupButton-CssClass="datePopUp" Width="260px" id="radDate" SelectedDate='<%# Bind("Date") %>' DateInput-BorderWidth="1px" DateInput-BorderColor="#7F9DB9" Runat="server" MinDate="2000-01-01">
<DateInput runat="server" DateFormat="dd/MM/yyyy" Width="260px" BorderColor="#7F9DB9" BorderWidth="1px" InvalidStyleDuration="100">
</DateInput>
</telerik:RadDatePicker>
</div>
</div>
</div>

<div style="width:800px;padding:0px 0px 10px 0px;">
<div style="float:left;width:400px;">
<div style="float:left;width:100px;">Type</div>
<div style="float:left;">
<asp:TextBox ID="txtType" runat="server" Width="240px" Text='<%# Bind("Type") %>'
ValidationGroup="Group1"></asp:TextBox><br />
</div>
</div>
</div>

<div style="width:800px;padding:0px 0px 10px 0px;">
<div style="float:left;width:400px;">
<div style="float:left;width:100px;">PO Number</div>
<div style="float:left;">
<asp:TextBox ID="acPONumber" runat="server" Width="240px" Text='<%# Bind("PONumber") %>'></asp:TextBox><br />

</div>
</div>
</div>

<div style="width:800px;padding:0px 0px 10px 0px;">
<div style="float:left;width:400px;">
<div style="float:left;width:100px;"><asp:Label ID="lblEstimatedAmount" runat="server" Text="Estimated Amount"></asp:Label></div>
<div style="float:left;">
<asp:TextBox ID="acEstimatedAmount" runat="server" Width="240px" Text='<%# Bind("Rate") %>'></asp:TextBox><br />
</div>
</div>
</div>
</div>
</ItemTemplate>
</asp:FormView>
GridView :
<asp:GridView ID="gridSupplierPurchasesDetail" DataSourceID="dsPurchasesDetail" runat="server" AutoGenerateColumns="False" AllowSorting="True" BorderStyle="Solid" BorderColor="#5E5EAE" BorderWidth="1pt"
CellPadding="5" Font-Names="Helvetica,Arial,Sans-Serif" Font-Size="9pt" DataMember="DefaultView"
SkinID="gridSkin" EmptyDataText="No Supplier Purchases Added to this Reference"
EnableTheming="False" Width="755px" ShowFooter="True" FooterStyle-VerticalAlign="Top" RowStyle-VerticalAlign="Top">
<HeaderStyle BackColor="#5E5EAE" ForeColor="White" HorizontalAlign="Left" />
<EmptyDataRowStyle VerticalAlign="Top" />
<RowStyle VerticalAlign="Top" />
<FooterStyle VerticalAlign="Top" />
<Columns>
<asp:TemplateField HeaderText="Description" SortExpression="Description">
<ItemTemplate>
<asp:TextBox ID="txtDescription" Width="200px" runat="server" Text='<%# Bind("Description") %>'></asp:TextBox>

</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="NetAmount" SortExpression="NetAmount">
<ItemTemplate>
<asp:TextBox ID="txtNetAmount" width="80px" runat="server" Text='<%# Bind("NetAmount") %>'></asp:TextBox>

</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="VATRates" SortExpression="VATRates">
<ItemTemplate>
<asp:DropDownList AutoPostBack="true"
ID="ddlVATRates" runat="server"
Width="80px"></asp:DropDownList>

</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="VATAmount" SortExpression="VATAmount">
<ItemTemplate>
<asp:TextBox ID="txtVATAmount" width="80px" runat="server" Text='<%# Bind("VATAmount") %>' ReadOnly="true"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="TotalAmount" SortExpression="TotalAmount">

<ItemTemplate>
<asp:TextBox ID="txtTotalAmount" width="80px" runat="server" Text='<%# Bind("TotalAmount") %>' ReadOnly="true"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>

<asp:TemplateField HeaderText="PartNumber" SortExpression="PartNumber">
<ItemTemplate>
<asp:TextBox ID="txtPartNumber" runat="server" class="PartNumber" Width="100px" Text='<%# Bind("PartNumber") %>' ValidationGroup="Group2"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>

数据源控制:
<asp:ObjectDataSource ID="dsPurchases" runat="server" SelectMethod="GetSupplierPurchasesByID" TypeName="SupplierPurchasesSystem" OldValuesParameterFormatString="original_{0}" >
<SelectParameters>
<asp:Parameter Name="SupplierPurchasesID" Type="Int32" DefaultValue="13243" />
<asp:Parameter DefaultValue="VNE_DB" Name="DataSource" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
<asp:ObjectDataSource ID="dsPurchasesDetail" runat="server" SelectMethod="GetSupplierPurchasesDetails"
TypeName="SupplierPurchasesSystem" >
<SelectParameters>
<asp:ControlParameter ControlID="HiddenField1" DefaultValue="" Name="guid" PropertyName="Value"
Type="String" />
<asp:Parameter DefaultValue="VNE_DB" Name="DataSource" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
<asp:HiddenField ID="HiddenField1" runat="server" />

任何帮助将不胜感激。

最佳答案

老实说,最可能的原因是您的FormView没有显示的是你没有从你的数据源中得到任何东西。您可以创建一个 EmptyDataTemplate 为您 FormView为了确定。把它放在您的 </ItemTemplate> 之后在您的 </asp:FormView> 之前

<EmptyDataTemplate>
There is nothing to see here.
</EmptyDataTemplate>

关于asp.net - FormView 不显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10125308/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com