Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ContentPage Control (mv) --> MasterPage Access

Is it possible to acces a control thats located in a content page (withing a content place holder, a multiview control to be more exactp) from the master page?

The situation is, i have a menu with buttons thats located in the master page.

Now in my content page i have 1 content place holder. In which a multiview with several views is located.

If i press a button in the menu (MasterPage) then it should open the proper view (with its controls) displayed in the content place holder area.

I have set the ActieveViewIndex=0 but i am getting all sorts of wierd behavour. I have to do something with the ActiveViewIndex++ somewhere but nothing seems to work.

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? Kind Regards.

like image 340
Tonz Avatar asked Dec 06 '25 15:12

Tonz


1 Answers

You can easily do that using find control

View myView = (View)this.Master.FindControl("PlaceHolderFullMain").FindControl("PlaceHolderMain").FindControl("Mymultiview")
like image 170
code master Avatar answered Dec 08 '25 04:12

code master



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!