Solved

TreeView in site master refresh when page data changes

Posted on 2014-03-01
2
636 Views
Last Modified: 2014-03-01
I have a stock standards asp.net 4.5 web forms application.

I am using master pages. in site.master I have a TreeView that I am using for navigation. It changes when data events happen in the pages.  in site.master.cs I have a

 private void BindNavTree() {}  method.  I want to call this method whenever data changes in any of the pages.

Any Help is appreciated

Thanks
0
Comment
Question by:charlesbaldo
2 Comments
 
LVL 16

Accepted Solution

by:
Easwaran Paramasivam earned 500 total points
ID: 39897747
It should be called if it is defined in master page correctly.

Otherwise there is another option..

You create a class file which derive  from Page class.

Example:


public class MyPage : Page
{

 //define the events and method here

//Have the method here...
private void BindNavTree() {}


}


then keep the class as your base page.


your aspx.cs

protected class test : MyPage
{


}


For your reference: http://www.asp.net/web-forms/videos/aspnet-dynamic-data/how-do-i-make-custom-pages

http://www.devexpertise.com/2009/03/25/aspnet-tiptrick-use-a-base-page-class-for-all-application-pages/
0
 

Author Closing Comment

by:charlesbaldo
ID: 39897797
Thank You
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question