views:

101

answers:

3

Is there a way to find all web pages that implement a specific master page in Visual Studio?

I'm looking for a shortcut like shift F12 that will find all usages of a master page. When I do it on the master page class name it only takes me to the design view instead of showing all pages that use it.

I do have Resharper if there is something in there that will help.

I know that I can use the Find dialog but that is not as nice.

A: 

That would be very hard to do. You can set master pages in the aspx-files, web.config or in the Page_PreInit event, which make it impossible to know exactly which master page is going to be used.

What MasterPage to you think is used here?

protected void Page_PreInit(object o)
{
  this.Master = GetMasterFromDataBase(HttpContext.Current.User.Username);
}

As you can see, there is no way to be sure which master page is really used.

vimpyboy
Thats a good point, but all ours are declared declaritively in the aspx so it seems odd that I can't easily navigate to them from the master page class.
Si Keep
+1  A: 

You mention that the FindDialog isn't that good... and I would agree if I'm was just using the Find Next dialog. But the "Find All" will display a list of all of the pages, then you can double click on each item in the list (as it stays open).

Control + Shift + F (or press the folder icon with the binoculars).

Timothy Khouri
A: 

You have this functionality now in ReSharper 5.0.

Hadi Hariri