Hello,
This is a button click event and it works:
private void btnSubmit_Click(object sender,
System.Web.UI.ImageClickEventArgs e)
{
string myPar = txtBox.Text;
SwitchToPage(myPar);
}
I needed to switch the page if there is a parameter provided in the URL. The
following does not work on the same page although myPar is the same in both
cases, SwitchToPage return exception as "A control cannot modify its
parents' control collections"
private void Page_Load(object sender, System.EventArgs e)
{
if(!Page.IsPostBack)
{
string myPar=Request.QueryString["MyPar"];
if(myPar!=null)
{
SwitchToPage(myPar);
}
}
}
Any idea where the problem might be? Is there any other way I can realize
the same thing?