C# ControlParameter正在返回以前的值?
我正在尝试创建主视图/详细视图。MyC# ControlParameter正在返回以前的值?,c#,asp.net,gridview,webforms,C#,Asp.net,Gridview,Webforms,我正在尝试创建主视图/详细视图。MyDetailsView工作正常,在自己的页面上,MyGridView显示MyEquipmentDataSource也工作正常。我可以使用filterParameters过滤GridView: <FilterParameters> <%-- ControlParameter.Name will String.Formatted with the control's value --%> <asp:ControlPar
DetailsView
工作正常,在自己的页面上,MyGridView
显示MyEquipmentDataSource
也工作正常。我可以使用filterParameters
过滤GridView
:
<FilterParameters>
<%-- ControlParameter.Name will String.Formatted with the control's value --%>
<asp:ControlParameter Type="String" Name='eEquipment.Contains("{0}")' ControlID="txtNumber" PropertyName="Text" />
</FilterParameters>
我正在调用加载页面上的
Page.DataBind()
。我试图在每个控件上手动调用DataBind()
,以防它以奇怪的顺序发生,但这似乎没有帮助。看起来我对control.DataBind()
是否阻塞感到困惑
protected void Page_Load(object sender, EventArgs e)
{
AutoMapperConfiguration.Initialize();
dtvProcurements.DataBind();
GridView1.DataBind();
}
在执行以下操作时无法正常工作:
protected void Page_Load(object sender, EventArgs e)
{
AutoMapperConfiguration.Initialize();
dtvProcurements.DataBind();
}
protected void dtvProcurements_DataBound(object sender, EventArgs e)
{
GridView1.DataBind();
}
protected void Page_Load(object sender, EventArgs e)
{
AutoMapperConfiguration.Initialize();
dtvProcurements.DataBind();
}
protected void dtvProcurements_DataBound(object sender, EventArgs e)
{
GridView1.DataBind();
}