ContentPage Control (mv) & # 8594; Access to MasterPage

Is it possible to access the control located on the content page (with the placement owner, control over several views, which will be more accurate) on the main page?

Situation: I have a menu with buttons located on the main page.

Now on my content page I have 1 placement owner. In which there is a multivisor with several views.

If I click a button in the (MasterPage) menu, then it should open the correct view (with its controls) displayed in the content holder area.

I set ActieveViewIndex = 0, but I get all kinds of belligerent behavior. I need to do something with ActiveViewIndex ++, but nothing works.

edit ::

string a = Request.Querystring["one"]
string b = Request.QueryString["two"]
if ( a == "addOne") // where addone is a redirection to the content page from the master page button
{
   mvMultieView.SetActiveView(vView1);
}
else
if ( b == "addTwo")
{
    mvMultieView.SetActiveView(vView2);
}

Any suggestions? Sincerely.

+3
3

( , , ) , ( ). QS iView, ( , , ). / , , ( , ), . (, ), activeView. ( , ) .

http://www.mydomain.com/mypage.com?iView=mySecondView

partial class MyControl : System.Web.UI.WebControl
{
    // blah blah control stuff

    public string getRequestedView()
    {
        return (Request.QueryString["iView"]) ? Request.QueryString["iView"] : String.Empty;
    }
}

...

protected void Page_Load(object sender, EventArgs e)
{
    View myView = myMultiView.FindControl(this.getRequestedView());
    if(myView != null)
        this.MyView.SetActiveView(myView);
}
+1

find control

View myView = (View)this.Master.FindControl("PlaceHolderFullMain").FindControl("PlaceHolderMain").FindControl("Mymultiview")
+2

? .

I have links on my homepage where I need to activate controls on the content page. the content page is not a page currently loaded.

will this method help for my solution?

0
source

Source: https://habr.com/ru/post/1779626/


All Articles