ObjectDataSource下的
<SelectParameters>
<asp:QueryStringParameter Name="region_idx" QueryStringField="region_idx" Type="Int32" />
</SelectParameters>
protected void FormView1_ItemInserted(object sender, FormViewInsertedEventArgs e)
{
Label4.Text = "插入数据成功!";
string test=ObjectDataSource2.SelectParameters[0].DefaultValue=e.Values[2].ToString();
}他获得一个QueryStringParameter,我的页面上有2个控件 FormView和GridView
我在
FormView
的ItemInserted事件中设置了SelectParameters的值。 然后GridView可以显示查出来的值但是问题来了,如果我之前传递过SelectParameters的值,URL是这样的
http://localhost/show.aspx?region_idx=2即使我在FormView
ItemInserted事件中设置ObjectDataSource的SelectParameters的值,GridView显示的结果也还是region_idx=2的结果。
我如何控制让ItemInserted事件后ObjectDataSource的SelectParameters值不再被改变
<SelectParameters>
<asp:QueryStringParameter Name="region_idx" QueryStringField="region_idx" Type="Int32" />
</SelectParameters>
protected void FormView1_ItemInserted(object sender, FormViewInsertedEventArgs e)
{
Label4.Text = "插入数据成功!";
string test=ObjectDataSource2.SelectParameters[0].DefaultValue=e.Values[2].ToString();
}他获得一个QueryStringParameter,我的页面上有2个控件 FormView和GridView
我在
FormView
的ItemInserted事件中设置了SelectParameters的值。 然后GridView可以显示查出来的值但是问题来了,如果我之前传递过SelectParameters的值,URL是这样的
http://localhost/show.aspx?region_idx=2即使我在FormView
ItemInserted事件中设置ObjectDataSource的SelectParameters的值,GridView显示的结果也还是region_idx=2的结果。
我如何控制让ItemInserted事件后ObjectDataSource的SelectParameters值不再被改变
我的ObjectDataSource的SelectParameters绑定的是region_idx的值。在另一个控件FormView1_ItemInserted事件中设置了ObjectDataSource的SelectParameters的值。如何它在后面不再获取region_idx=2 的值