母版页多个ContentPlaceHolder间控件通讯问题

chenguofeng chenguofeng 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我定义了一个母版页,有两个ContentPlaceHolder。在第一个ContentPlaceHolder中纺织了一个DropDownList控件,在第二个里边防治了一个gridview和一个objectdatasource控件。目的是想通过 dropdownlist控件给objectdatasource传递参数,进而更新gridview中的数据。页面aspx代码如下:

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True">
</asp:DropDownList>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

<asp:GridView ID="GridView1" runat="server" AllowPaging="True" CssClass="datatab"
AutoGenerateColumns="False" DataSourceID="ObjectDataSource1"
DataKeyNames="id">
......
</asp:GridView>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
DeleteMethod="Delete" SelectMethod="Get" TypeName="Spark.DAL.Users">
<DeleteParameters>
<asp:Parameter Name="id" Type="String" />
</DeleteParameters>
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList1" DefaultValue="" Name="ked"
PropertyName="SelectedValue" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>

</asp:Content>

但在运行是,却提示:未能在 ControlParameter“ked”中找到控件“DropDownList1”。求解。
...全文

相关推荐

评论 9
收藏 已收藏
分享
返回顶部
chenguofeng
.NET社区 62,272 成员 668,968 内容