我的ASP.NET应用程序中有多个FormView,它们中有不同的控件,如文本框和下拉列表。
首先,在我的数据库中,我有一个包含大量详细信息的用户列表。在我的应用程序中,我有一个文本框,我可以在其中搜索用户,它将使用SqlDataSource填充我的一个表单视图,但是我的其他表单视图在搜索时不会自动填充,这是用户将填充的部分然后按提交,然后将包括预先填充的数据在内的所有数据提交回数据库。
我不知道从哪里开始这个并且如果有人可以给我一些例子或指出我如何做到这一点的正确方向,我将不胜感激。
以下是我的一个FormViews的示例:
<div class="compliant-details">
<asp:FormView runat="server" DataSourceID="ds_complaints" CssClass="complient-details-first-section" DefaultMode="Insert">
<InsertItemTemplate>
<div class="compliant-details-method">
<label class="applicationfont">Method:</label>
<asp:DropDownList class="smallinputbox" runat="server" ID="ddl_compliant_details_method" DataSourceID="ds_compliantmethod"
DataTextField="ComplaintMethod" DataValueField="ComplaintMethodId" AppendDataBoundItems="true">
<asp:ListItem Value="0" Text="<Please Select>" />
</asp:DropDownList>
</div>
<div class="compliant-details-type">
<label class="applicationfont">Type:</label>
<asp:DropDownList class="smallinputbox ddl" runat="server" ID="ddl_compliant_details_type" DataSourceID="ds_types"
DataTextField="TypeName" DataValueField="TypeId" AppendDataBoundItems="true">
</asp:DropDownList>
</div>
<div class="compliant-details-status">
<label class="applicationfont">Status:</label>
<asp:DropDownList class="smallinputbox" runat="server" ID="ddl_compliant_details_status" DataSourceID="ds_status"
DataTextField="Status" DataValueField="StatusId" AppendDataBoundItems="true">
<asp:ListItem Value="0" Text="<Please Select>" />
</asp:DropDownList>
</div>
<div class="compliant-details-catagory">
<label class="applicationfont">Catagory:</label>
<asp:DropDownList class="smallinputbox" runat="server" ID="ddl_compliant_details_catagory" DataSourceID="ds_category"
DataTextField="Category" DataValueField="Categoryid" AppendDataBoundItems="true">
<asp:ListItem Value="0" Text="<Please Select>" />
</asp:DropDownList>
</div>
<div class="compliant-details-recorded-by">
<label class="applicationfont">Recorded By:</label>
<asp:DropDownList class="smallinputbox" runat="server" ID="ddl_compliant_details_recorded_by" DataSourceID="ds_agents"
DataTextField="AgentName" DataValueField="AgentId" AppendDataBoundItems="true" />
</div>
<div class="compliant-details-handeld-by">
<label class="applicationfont">Handeld By:</label>
<asp:DropDownList class="smallinputbox" runat="server" ID="ddl_compliant_details_handald_by" readonly="readonly" DataSourceID="ds_agents"
DataTextField="AgentName" DataValueField="AgentId" AppendDataBoundItems="true" />
</div>
<div class="compliant-details-rfc-sent">
<label class="applicationfont">RFC Sent:</label>
<div class="compliant-details-rfc-rb">
<asp:RadioButton runat="server" ID="rb_compliant_details_rfc_sent_yes" Text="Yes" CssClass="applicationfont" GroupName="rfcsent" />
<asp:RadioButton runat="server" ID="rb_compliant_details_rfc_sent_no" Text="No" CssClass="applicationfont" GroupName="rfcsent" />
</div>
</div>
<div class="compliant-details-accepted-by-client">
<label class="applicationfont">Accepted By Client:</label>
<div class="compliant-details-accepted-rb">
<asp:RadioButton runat="server" ID="rb_compliant_details_accepted_by_client_yes" Text="Yes" CssClass="applicationfont" />
<asp:RadioButton runat="server" ID="rb_compliant_details_accepted_by_client_no" Text="No" CssClass="applicationfont" />
</div>
</div>
</InsertItemTemplate>
</asp:FormView>
答案 0 :(得分:0)
为什么不在同一FormView上使用“编辑模板”?
为什么有多个FormView?