我在 Datalist 中为 CheckBoxList 使用 RequiredField Validator 时遇到问题。我正在使用复选框列表进行投票选项。我希望用户回答所需的投票问题。如果用户没有回答,我想显示一条错误消息。任何人都可以帮我做到这一点吗?
这是我的设计:
<div id="divPollDataList">
<asp:DataList ID="PollDataList" runat="server"
onitemdatabound="PollDataList_ItemDataBound">
<ItemTemplate>
<asp:HiddenField ID="PollIDReqHiddenField" Value='<%# Eval("PollID") %>' runat="server" Visible="false" />
<asp:Label ID="lblReqQuestionNumber" runat="server" Text='<%# Eval("No of PollQuestion") %>' Font-Bold="true"></asp:Label>
<asp:Label ID="lblRequiredPollQusetion" runat="server" Text='<%# Eval("PollQuestions") %>' Font-Bold="true"></asp:Label>
<asp:HiddenField ID="HiddenFieldPollOption" runat="server" Value='<%# Eval("PollOptions") %>' Visible="false" />
<asp:HiddenField ID="HiddenFieldPollType" runat="server" Value='<%# Eval("PollType") %>' Visible="false"/>
<asp:RequiredFieldValidator ID="RequiredFieldValidatorReqPoll" runat="server" CausesValidation="true" ControlToValidate="CheckBoxListMultiple" Display="Dynamic" ErrorMessage="You must provide the feedback" ></asp:RequiredFieldValidator>
<asp:CheckBoxList ID="CheckBoxListMultiple" runat="server" ></asp:CheckBoxList>
</ItemTemplate>
</asp:DataList>
</div>
<div>
<asp:Button ID="btnSubmitPoll" runat="server" CausesValidation="true" Text="Submit" …
Run Code Online (Sandbox Code Playgroud) 有没有办法使用 Tamir.SharpSsh 从 SFTP 服务器获取基于修改日期的文件?目前我正在按文件名下载文件,但我的要求是按修改日期。
var sftp = new Sftp(Host, UserName, Password);
sftp.Connect();
sftp.Get(sourcePath+"/*.*." + name + "*", destinationPath);
Run Code Online (Sandbox Code Playgroud)