How To Select Master Pages That Are Provided By A VirtualPathProvider

Oct 15, 2010

We got a lot of intranet websites that share the same design. Therefore we've put the master pages, stylesheet, images and javascripts in a shared assembly.

The content is loaded by using:

HostingEnvironment.RegisterVirtualPathProvider(new VirtualFilesProvider());
ViewEngines.Engines.Clear();
ViewEngines.Engines.Add(new WebFormViewEngineWithOurVirtualPathProvider());

The problem is that Visual Studio cannot find the images or masterpage and therefore gives us a lot of warnings + that we cannot select the masterpage when creating new view pages.

Note: Everything works fine when running the websites.

View 1 Replies


Similar Messages:

Web Forms :: VS2010 Master Pages / Everything Shows On The New Pages Except The Jpeg Image Logo?

Sep 5, 2010

i'm developing a site using VS2010 and with my windows vista busniness OS. i used the default VS2010 wizard for new web application to create it. included a folder in the root directory and created new aspx pages to derive from the master page in the root directory of my site. everything shows on the new pages except the jpeg image logo in the master page. But other aspx pages i created in the root directory shows every thing fine.

View 1 Replies

Web Forms :: Master Pages - All My Pages Inherit From The Base Page Class

Jun 21, 2010

Currently I'm doing common functionality required throughout my site inside of my masterpage. What I want to do is move this functionality to a BaseClass so All my pages inherit from the Base Class. However, I'm not sure how to set this up interms of c# code with regards to Using a Base Class and then having a masterpage applied to my aspx pages that i create.

View 5 Replies

AJAX :: Set Title For Content Pages When Working With Master Pages?

May 17, 2013

How can we add titles to each content pages which inherits from mater pages in asp.net?

View 1 Replies

Web Forms :: Use Link Master Pages In Content Pages?

May 11, 2010

My requirement was to share master files among diff projects i read this doc [URL] so i use this technique to share msster pages among my diff projects in a soln but i dnt know how to reference such shared master page as if i use such

<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="../masterPages/masterInvGen.Master"

View 1 Replies

Combining CSS And JS In Master Pages And View Pages With SquishIt?

Jul 2, 2010

How do you implement SquishIt to bundle Css/Js across View Pages and Render it in the Master page? I thought I could use a ContentPlaceHolder above the Render portion, but there seems to be some odd behavior where it sometimes adds 3 files (1 in the view page and 2 in the master page) but other times will ignore the file added from the View Page.

Index.aspx
<asp:Content ContentPlaceHolderID="CssFiles" runat="server">
<% CssHelper.Add("home.css"); %>
</asp:Content>
Site.master
<asp:ContentPlaceHolder ID="CssFiles" runat="server" />
<% CssHelper.Add("reset.css"); %>
<% CssHelper.Add("master.css"); %>
<%=CssHelper.Render() %>

My current solution is a Static wrapper around SquishIt's static Bundle class that keeps the BundleBuilder in HttpContext.Current.Items.

I'm curious if this has been done successfully and how so.

View 2 Replies

C# - Possible With ASP.NET Master Pages To Create Content Pages Dynamically?

Jan 22, 2010

Is it possible with ASP.NET Master Pages to create content pages dynamically?That is, I know we can create content dynamically, but the content pages themselves,can those be created programmatically? I want to give my users the ability to define new content pages (i.e. Categories: Sofas, Tables, Lamps, and add/delete as they see fit) through a management panel. The resulting content pages should have proper URL naming, so that they index properly.An example: http://www.example.com/products/Lamps/contentpage.aspx.Is there a demonstration of this somewhere I can view?

View 4 Replies

Web Forms :: Changes In Master Page Does Not Apply To Nested Master Pages

Aug 4, 2010

I got a Master page and nested master pages in the subfolders.

Top Level Master page

Second Level Master page inherited Top Level Master page

Third Level Master page inherited Second Level Master page

However, changes (i.e. new images & alt. name) that I made in the Top level master page did not apply to the second or third levels.My webpage has a correct front page but not in the sections. How can i correct this ?

View 3 Replies

Difference Between Master Page And Master Pages In .Net?

Apr 1, 2011

what is difference between Master page and Master Pages in ASP.Net. Is both are same or different.

View 3 Replies

Custom VirtualPathProvider Not Being Used In IIS6?

Aug 30, 2010

I added the following lines to Application_Start method in global.asax:

var provider = new TestVirtualPathProvider();
HostingEnvironment.RegisterVirtualPathProvider(provider);

Yet the 'TestVirtualPathProvider' is never used when deploying this application in IIS6 (it does in the ASP.NET Development Server).

Edit: the default path provider has always done its job correctly and served (non-embedded) views correctly. The problem is simply that I want to use my own path provider to provide embedded views. So, initially, I already had the following wildcard mapping configured:

Any possible reasons why this does not work in IIS6? Are there any other factors (handlers for example) wich might influence the used VirtualPathProvider?

View 4 Replies

MVC 2 VirtualPathProvider GetFile Every Time For Every Request?

Sep 19, 2010

I am fresh in ASP.NET MVC framework. This is may be a silly question for you. Sorry about that.I have implemented a VirtualPathProvider. The VirtualPathProvider reads the view from File system.However my problem is the method GetFile(string virtualPath) is not executed every time for every request. I think it is related to the caching, isn't it? What I want is getting file every time for every request. Because for some cases, the page in the file system will be modified and users want the system shows the changes immediately.

View 1 Replies

Web Forms :: Batch Creation Of Content Pages (re: Master / Content Pages)

Apr 19, 2010

I have over 300 content pages to create. Each has some standard styling. I would like to generate these pages, and was just wondering if there is a utility in web developer 2008 express to do so (otherwise I will just build one - but it would be great not having to do so!)

View 1 Replies

MVC :: Razor View Engine - 'content' From DB Using VirtualPathProvider?

Dec 14, 2010

I'm working trying to realize a requirement where the pages should be 'configurable' at runtime (per client), stored in a database - a requirement that I have no say in Anyway, the current plan is to use the Razor view engine and 'load' the 'pages' dynamically. I have a basic sample working using a VirtualPathProvider and VirtualFile that serves up Raz'pages' on the fly.The question I have if there is a better approach when I have the Razor 'pages' stored in a dB (or any other repository)?

There seems to be some constraints and concerns when I check other postings. For example:'If a Web site is precompiled for deployment, content provided by a VirtualPathProvider instance is not compiled, and noVirtualPathProvider instances are used by the precompiled site.'
(from http://msdn.microsoft.com/en-us/library/system.web.hosting.virtualpathprovider.aspx )

View 1 Replies

Web Forms :: Master Pages - How To Access Content Page From Master Page

Sep 5, 2010

I have a master page setup that is used throughout my site that is basically a header with a menu. I recently added a textbox and a button to this master page which is to be a quick search box that is available anywhere in the site. When a user enters text into the search box and hits the button, I need to load the actual content page which is used to search and show search results (which also uses this same master page), and have the text entered available so the search can be triggered automatically. Again, this search text box and button is now in my master page so it could be triggered from anywhere in the app... it serves as a convenient way to do a basic search from anywhere in my app, without having to first navigate to the actual 'search page' that already exists. You can also navigate to the actual search page, which uses the same master page, where there is many more search options.I'm thrown off by the master page arrangement, which I have not used until this project. What do I do?

View 4 Replies

Custom VirtualPathProvider - Unable To Serve URLs Ending With A Directory

Jan 20, 2010

As part of a CMS, I have created a custom VirtualPathProvider which is designed to serve a single file in place of an actual file structure. I have it set up such that if a file actually exists on the server, that file will be served. If the file does not exist, the virtual content stored for that address will be served instead. This is similar to the concept of serving a website from files stored in a database, though in this case the content is stored in XML files on the server.

This setup works perfectly when a request is made to a specific page. For example, if I ask for "www.mysite.com/foobar.aspx", the content that is stored for "foobar.aspx" will be served. Further, if I ask for "www.mysite.com/subdir/foobar.aspx", the appropriate content will also be served.

The problem is this: If I ask for something like "www.mysite.com/foobar", things begin to fall apart. If the directory exists on disk (and doesn't have a configured default page in IIS, such as index.aspx), I will get a "Directory Listing Denied" error. If the directory does not exist, I'll simply get a 404 - Resource Not Found.

I've tried several things, and so far nothing I've done has made a bit of difference. It seems as though IIS is simply noting the nonexistence of a directory (or default file in an existing directory) and serving up its own error code, without ever asking my application what to do with the request. If it ever did get to the application, I would be able to solve the problem, but as it stands, I'm quite lost. Does anyone know if there is some setting in IIS that is causing this?

I've looked for every resource I can find on the subject, and am coming up empty. I know this should be possible, because I have read tutorials on serving content from both databases and ZIP files.

p.s., I am running IIS6 and .NET 3.5

View 1 Replies

Converting Content Pages To Nested Master Content Pages In .net

Jul 28, 2010

I have a main master page, say MasterPageMain, and a couple of folders with couple of pages in each folder which act as a child page to that master page - MasterPageMain.

Now, I have about 10 pages in one of the folder which follows a certain pattern and they could really use a nested pages since any change on some parts needs me to change all the pages which is a pain really.

I already added a Nested master page, say NestedMasterPage - which is a child of MasterPageMain

I tried to change one of the page's <%@ Page directive to NestedMasterPage, immediately, there were a lot of errors. plus I dint know where the NestedMasterPage's children content would go.

What do I need to know in order to do this succesfully?

ps: I dint do this initially because I only had 2 pages, and I dint need this at that time, as the project grew, now i see that I should have changed it much earlier..

View 2 Replies

How To Know The Census Out There On Master Pages

Mar 24, 2010

I want to know what is the census out there on Master pages? Like using them? Hate using them? Pros and cons.

View 1 Replies

How To Include CSS In Master Pages

Oct 25, 2010

How do I include CSS reference in only certain pages on my asp.net website? If I include the reference in my master page, all pages of the website share the CSS reference.

View 2 Replies

MVC :: To Add Nested Master Pages ?

Feb 9, 2010

Using MVC 2 for what it matter. (And also keep in mind for some reason I NEVER used Nested Master Pages)

I got a single Master page that work across my site.

However, I found from the design now, that each "Area" have a different subnavigation.

Figured it might finally be a reason to use Nested Master Pages....resulting into a lot of swearing over here...

What I did:Add a "Nested Master Page" to the "Shared" folder of a specific Area
(project/Areas/xxxx/Views/Shared/NestedMasterPage.Master)VS bring up a box asking to specify a Master Page, and I select the only one i have (project/Views/Shared/Site.Master)Leave it as is, I add a new View and for it's Master Page I browse to the new Nested Master Page.When I click Add, the following Error comes up:"The ContentPlaceHolder 'MainContent' doesn't exists in the Master page '~/Areas/xxx/Views/Shared/NestedMasterPage.master'. Please choose a valid ID for this Master Page.Bit buffled..the code for the nested master look like this:[Code]....

'MainContent' right there, or what is VS talking about?

View 2 Replies

How To Configure Master Pages

Feb 3, 2011

trying to configure master page for my project in visual studio 2008 and all the tutorials i have found none seem so resourceful if any one has a good site, article, or a video tutorial that can help me out i appreciate a lot.

View 4 Replies

MVC :: Using Menus In Master Pages?

Jul 27, 2010

My web site will have lots of pages, too many to provide links for in the menu as shown in the form of the wizard-generated menu. One solution I'm investigating is to have a main menu where each item will pop up a submenu, like in a Windows app.

Can I use a "Menu" control in a master page to do a pop up menu? If so can you point me to an example or show me (a novice) how to do it? I.e., each item will have a controller action, so how do I connect the menu item to the action method?

View 3 Replies

Web Forms :: SEO Using Master Pages?

Feb 10, 2010

Is there a way to assign pages created from a master page with their own meta tags? I know that some search engines don't weight meta tags very highly, but I still would like to use them if possible.

View 3 Replies

Client Callbacks With Master Pages?

Aug 30, 2010

I'm following this example: [URL]

And I can get it to work with just a single page and a code behind, but when I add a masterpage, the examples doesn't work properly. Within my master page, I have a head content section and a body content section. It's nothing fancy.

How do i do client callbacks with master pages?

View 2 Replies

Web Forms :: Which Is Better - Master Pages Or CSS Or Combination

Dec 25, 2010

I have spent time learning coding using master pages in inline styles and my sites are functional but look lousy. Now I am turning to learning CSS and to make my sites look more professional.

I wanted to try to convert my sites to using CSS. So I ask the question which is better option?

Also does anyone who develops in a corporation know if Master pages are use much?

View 3 Replies

JQuery UI Not Working With Master Pages

Feb 8, 2011

I've successfully made JQuery work with Master Pages, but not JQuery UI.My header in the master page looks like this:

<head runat="server">
<title>Analytics</title>
<link href="~/css/PageElements.css" rel="stylesheet" type="text/css" runat="server"/>
<link href="~/css/FormElements.css" rel="stylesheet" type="text/css" runat="server"/>
<link href="~/css/Buttons.css" rel="stylesheet" type="text/css" runat="server"/>
<link href="<%# ResolveUrl("~/css/smoothness/jquery-ui-1.8.9.custom.css") %>" rel="Stylesheet" type="text/css" />
<script type="text/javascript" src="<%# ResolveUrl("~/Scripts/jquery-1.4.4.min.js") %>" />
<script type="text/javascript" src="<%# ResolveUrl("~/Scripts/jquery-ui-1.8.9.custom.min.js") %>" />
<script type="text/javascript">
jQuery.noConflict(); <%--This should avoid conflicts Ajax Control Toolkit--%>
</script>
<asp:ContentPlaceHolder ID="HeaderPlaceHolder" runat="server" />
</head>

And in the content page, I created a VERY simple script to load the Date Picker, as per JQuery UI demo page. I always get a 'Microsoft JScript runtime error: Object doesn't support this property or method'. Here's my content page:

<asp:Content ID="MainContent" ContentPlaceHolderID="MainPlaceHolder" runat="server">
<script type="text/javascript">
jQuery(document).ready(function () {
jQuery('#<%=btnSubmit.ClientID %>').click(function () {
alert("Hello world!");
});
});
</script>
<script type="text/javascript">
jQuery(function () {
jQuery('#<%=datepicker.ClientID %>').datepicker();
});
</script>
<div class="demo">
<p>Date: <asp:TextBox runat="server" ID="datepicker" /></p>
</div>
<asp:Button ID="btnSubmit" runat="server" Text="Submit" />
</asp:Content>

The CSS folder is in place, and pure JQuery calls work. This simple datepicker is not working with this master page / content setup. I've tried many combinations for the datepicker ID, using ClientID (as is), UniqueID, [id$=datepicker], etc. Can someone shed a light on this? What am I missing?

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved