小编use*_*089的帖子

DropDown 不触发 OnSelectedIndexChanged

我有一个带有下拉列表的页面

   <asp:Content runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
  <asp:DropDownList ID="DropDownList1" runat="server" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
    <asp:ListItem>Cellsite</asp:ListItem>
    <asp:ListItem>Agreement</asp:ListItem>
    <asp:ListItem>Event</asp:ListItem>
    <asp:ListItem>User</asp:ListItem>
</asp:DropDownList>
<asp:Label runat="server" ID="EntityName"></asp:Label>
<ig:WebScriptManager ID="WebScriptManager1" runat="server"></ig:WebScriptManager>
<ig:WebDataGrid ID="EntityGrid" runat="server"  Width="100%">
    <Behaviors>
        <ig:Sorting>
        </ig:Sorting>
    </Behaviors>
</ig:WebDataGrid>
Run Code Online (Sandbox Code Playgroud)

后面的代码是

     protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {
        EntityName.Text = DropDownList1.SelectedItem.Text;
    }
Run Code Online (Sandbox Code Playgroud)

由于某种原因,标签永远不会更新,事件 selectedindexchanged 根本没有触发,我需要在此事件中添加动态网格。有什么线索吗?

c# asp.net

1
推荐指数
1
解决办法
1356
查看次数

CS1501:方法'btnsaveandclose_Click'没有重载需要0个参数

嗨,当我尝试运行aspx.cs时,我收到此错误

protected void btnsaveandclose_Click(object sender, EventArgs e)
{

    try
    {
        save();
    }
    catch (Exception ex)
    {
    }
}
Run Code Online (Sandbox Code Playgroud)

aspx是:

<asp:button id="btnsaveandclose" runat="server" text="save & close" 
     CausesValidation="true" onclick="btnsaveandclose_Click()" 
     usesubmitbehavior="false">
Run Code Online (Sandbox Code Playgroud)

html c# asp.net

-1
推荐指数
1
解决办法
1491
查看次数

标签 统计

asp.net ×2

c# ×2

html ×1