当我单击按钮时我有一个更新面板,但我没有输入方法。我在做什么错了。我已经搜索了很多,尝试了很多不同的更新模式,但都知道可以正常工作。
这是我的前端代码
<asp:ScriptManager ID="ScriptManager" runat="server" EnablePageMethods="true">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" ChildrenAsTriggers="true">
<ContentTemplate>
<asp:Label ID="Label6" runat="server" Text="Periodo de tiempo" CssClass="second-menu-title"></asp:Label>
<div class="form-row">
<div class="col-md-3 mb-3">
<label for="validationCountry">Año</label><br/>
<asp:DropDownList class="form-control" ID="drYear" runat="server" ></asp:DropDownList>
</div>
<div class="col-md-3 mb-3">
<label for="validationCountry">Mes</label><br/>
<asp:DropDownList class="form-control" ID="drMonth" runat="server" ></asp:DropDownList>
</div>
</div>
<asp:Button class="btn btn-primary" ID="btnTimeInterval" Enabled="True" runat="server" Text="Cambiar meses" onclick="selectedTimeIntervalClick"/>
<br/>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnTimeInterval" />
</Triggers>
</asp:UpdatePanel>
这是我的后端代码
protected void selectedTimeIntervalClick(object sender, EventArgs e)
{
string year = drYear.SelectedValue;
string month = drMonth.SelectedValue;
PopulateDateDropDownsAndSearchBoxes();
string selectContract = year.Substring(year.Length - 2) + month;
PopulateDefaultDates();
PopulateSearch();
}