Basically I have a userControl.ascx with a lot of code… this user control is used in the Child.MasterPage and the Child.MasterPage inherits from a Parent.MasterPage.
In the Parent.MasterPage I have a method in the .cs file, this method accepts a string and passes it to a literal.
The problem:
I have spent hours trying to pass a string from my UserControl directly to the Parent.MasterPage.cs method with no luck. The child.MasterPage does not have a c# file, it just inherits from the parent.master
a line of code that I am using so that I can pass values to the patent.MasterPage reads like this.. but I am not able to pass to the method please help!
MasterPage myMasterPage = this.Parent.Parent.Page.Master.Master;.
Try typecasting it like ((ParentMaster)this.parent.parent).SomeMethod()