hello,
i have a web page on which 3 user controls A,B,C are registered.
RadTab controlis used and User controls A and B is added on RadPageView 1 and 2 respectively.
User Control C also exists on the same web page but not on the RadTab.
By default, RadPageView 1 i.e. User Control A is selected.
On User Control B there exists a repeater to which some rows are binded.
On User Control C, there is a link button. When it is clicked, RadPageView 2 i.e. User Control B should be selected
and the repeater rows shud be filtered accordingly. Now, the problem is that when the link button is clicked
the repeater is having the correct number of rows but the RadPageView 2 is showing the correct number of rows
till i click the link button twice.
Please help.
Code Snippet:
UserControlB.ascx
=================
<
asp:Repeater
ID
=
"Repeater1"
runat
=
"server"
>
</
asp:Repeater
>
UserControlB.ascx.cs
====================
public void LoadPage(UserControlB uc)
{
Page_Load(uc, null);
}
protected void Page_Load(object sender, EventArgs e)
{
if (Session["ID"] != null)
{
int id = (int)Session["ID"];
DataTable dt = Fetch records from database based on id
Repeater1.DataSource = dt;
Repeater1.DataBind();
}
}
UserControlC.ascx
==================
<
asp:LinkButton
ID
=
"LinkButton1"
runat
=
"server"
onclick
=
"LinkButton1_Click"
>Show Details</
asp:LinkButton
>
UserControlC.ascx.cs
====================
protected void LinkButton1_Click(object sender, EventArgs e)
{
Session["ID"] = "23829839";
UserControlB uc = (UserControlB)this.Page.LoadControl("~/UserControlB.ascx");
uc.LoadPage(uc);
RadTabStrip radTabs = (RadTabStrip)cpHolder.FindControl("tabStrip");
RadMultiPage radMultiPage = (RadMultiPage)cpHolder.FindControl("RadMultiPage1");
radTabs.Tabs[0].Selected = false;
radTabs.SelectedIndex = 1;
radTabs.Tabs[1].PageView.Selected = true;
radTabs.MultiPage.SelectedIndex = 1;
radTabs.Tabs[1].Enabled = true;
radMultiPage.SelectedIndex = radTabs.SelectedIndex;
}