信息,我有一个ASP.NET DataList
,与页脚定义这样的:如何从DataList的脚注得到buttonClick
<FooterTemplate>
<asp:DropDownList ID="ddlStatusList" runat="server">
</asp:DropDownList>
<input id="txtNotes" type="text" placeholder="Notes" />
<asp:Button runat="server" type="button" Text="Add" ID="btnAdd"></asp:Button>
</FooterTemplate>
我正在寻找做的,就是对的btnAdd
点击,得到值从txtNotes
和ddlStatusList
,但我不能解决如何访问控件,更不用说值。
我不能按照像this这样的东西,因为我无法检查我的按钮是否已被点击(尽可能用复选框),即使如此,我不知道我是否会如展示的那样能够使用findControl
。 (“有不同的小号页脚的行为,以一个项目?
我不能使用Button
难道一个DataList
)”,因为当数据绑定,输入的文本不会同时存在,commandName
& commandValue
属性,因此我不能设置CommandValue
。
我已经使用LinkButton
而不是普通的.NET Button
不过来翻过了同样的问题,因此我不能工作了如何从TextBox
/DropDownList
+1 - 优秀!!!回发时DataList的DataListItems为null。我认为这是最好的方法之一。 – afzalulh