【发布时间】:2014-04-09 22:21:07
【问题描述】:
在下面的代码中,我有文本框、下拉列表、复选框等用户控件,并将其绑定到数据列表。现在我已将控件引用到 .aspx 网页,现在我的目标是获取 .aspx 页面中自定义控件的值。请帮助我做到这一点。我的目标是从 .aspx 中的usercontrols 获取文本框、下拉列表、复选框的值。
GmatField.ascx
<asp:TextBox ID="txtField" runat="server" width="200Px" CssClass="style22" ></asp:TextBox>
<asp:DropDownList ID="cbField" runat="server" width="200Px" >
</asp:DropDownList>
<asp:CheckBox ID="chField" runat="server" width="200Px" />
GmatField.ascx
<%@ Register TagPrefix="gmat" TagName="FieldCont" Src="~/Search/GmatField.ascx" %>
<asp:DataList ID="dlFields" runat="server" Height="100px"
Width="50px" BorderColor="Beige">
<ItemTemplate>
<gmat:FieldCont ID="gmatFieldCont" runat="server" />
</ItemTemplate>
</asp:DataList>
NewDocument.aspx
<%@ Register TagPrefix="gmat" TagName="GmatFieldsControl" Src="~/Search/GmatFields.ascx" %>
<gmat:GmatFieldsControl ID="gmatFieldsContr" runat="server" />
【问题讨论】:
-
不太清楚你想要什么我的朋友..请解释更多
-
我不知道你在说什么。
-
@ Karim AG 我在 GmatField.ascx 中有文本框、下拉列表、复选框等控件。现在我想在 NewDocument.aspx 中获取这些值