Click here to Skip to main content
15,888,401 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all, I want to hide/show a table in content page based on the button click event in the master page. please suggest me the solution.
Posted
Comments
[no name] 19-Oct-12 5:23am    
I need clarification in question
so, post it again clearly
Thank u
bapu_reddy 19-Oct-12 5:43am    
I have combo box and a button associated with it. Selecting the value in the combo and clicking on button it should be displayed the value in the label in content page. I hope you understood the question.....

1 solution

Use delegate event handling for this.
Here is sample example for you.

In Site.Master.cs
C#
public delegate void DoEvent();

        public event DoEvent OnDoEvent;

        protected void Button1_Click(object sender, EventArgs e)
        {
            if (OnDoEvent != null)
            {
                OnDoEvent();
            }
        }


in Default.aspx.cs
C#
protected void Page_Load(object sender, EventArgs e)
        {
            (this.Master as SiteMaster).OnDoEvent += new SiteMaster.DoEvent(_Default_OnDoEvent);
        }

        void _Default_OnDoEvent()
        {
            Test.Text = "Clicked";
        }


Hope it will help :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900