master-pages

How to use the site's masterpage from a _layout SharePoint page?

梦想与她 提交于 2019-12-07 10:13:42
问题 I want to use a masterpagefile (the site's one if this makes sense) in my SharePoint 12 hive/template/layouts/TelephoneBookList/test.aspx file. However, whenever I add MasterPageFile="~/_layouts/simple.master" or something like that to my test.aspx page, I get a sharepoint error page and the following in the log file: 01/12/2009 10:56:26.95 w3wp.exe (0x1064) 0x1280 Windows SharePoint Services Topology 0 Critical Invalid URL: http://localhost. You may also need to update any alternate access

ASP.NET MVC Master Page Data

元气小坏坏 提交于 2019-12-07 09:05:25
问题 The more I use ASP.NET MVC, the more I love it. However, in the case of showing model data on master pages there seems several ways of doing it. I am unsure as to the best solution. My example would be a commerce site where I want to output a list of product categories on every page and also show the status of the visitors cart. In asp.net web forms I would typically do this using user controls each doing their own databinding to retrieve the required data. In MVC all data should be passed by

How to persist scroll position using Master Page?

六眼飞鱼酱① 提交于 2019-12-07 06:49:33
问题 I have a site that uses master pages, the only content that changes is a Div in the centre of the page. Is there a way that I can persist the scroll position of the page between postbacks? I'm thinking that it might be possible because all pages are using the same Master Page, if not is there some other way to do this? Thanks 回答1: Try adding this.Page.MaintainScrollPositionOnPostBack = true; somewhere in the masterpage code behind (for example page load) 回答2: Try this: http://radio.javaranch

How to access controls in Main Master page from content page in Nested Master Page

旧时模样 提交于 2019-12-07 06:41:31
问题 I have 2 master pages that are nested.this is main master page code for example: <%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPageMaster.master.cs" Inherits="MasterPageMaster" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <asp:ContentPlaceHolder id="head" runat="server"> </asp:ContentPlaceHolder> </head> <body>

How to change the order of registered scripts in a ScriptManager

谁都会走 提交于 2019-12-07 00:40:56
问题 Background Within our master page we have a ScriptManager that looks something like this <asp:ScriptManager ID="ScriptManager" runat="server" EnablePartialRendering="False" EnableScriptLocalization="true"> <Scripts> <asp:ScriptReference Path="~/js/master.js" /> <asp:ScriptReference Path="~/js/jquery-min.js" /> </Scripts> </asp:ScriptManager> I'm registering additional scripts in nested controls on pages by doing the following protected override void OnPreRender(EventArgs e) { ScriptManager

ContentPlaceHolders: Repeated Content

久未见 提交于 2019-12-06 20:11:52
问题 Scenario I have an application using asp.net Master Pages in which I would like to repeat some content at the top and bottom of a page. Currently i use something like this: Master Page <html> <body> <asp:ContentPlaceHolder ID="Foo" runat="server"> </asp:ContentPlaceHolder> <!-- page content --> <asp:ContentPlaceHolder ID="Bar" runat="server"> </asp:ContentPlaceHolder> </body> </html> Content Page <asp:Content ID="Top" ContentPlaceHolderID="Foo" runat="server"> <!-- content --> </asp:Content>

How to create create variables/properties in master page, and let sub-pages access them?

孤者浪人 提交于 2019-12-06 16:00:42
How to create create variables/properties in master page, and let sub-pages access them? So my master will have a string property HomeUrl How can any page that uses the master page access this property? You should use a base class for you master page which will define you properties: public class BaseMasterPage : System.Web.UI.MasterPage { public string HomeUrl {get; set; } } And then your master page should inherit from this BaseMasterPage class (as example): // real master page public partial class Common_MasterPages_Backend_Default : BaseMasterPage { } After this you can access your

page_load event in Master and Content Pages

淺唱寂寞╮ 提交于 2019-12-06 15:40:16
Here is the sequence in which events occur when a master page is merged with a content page: http://msdn.microsoft.com/en-us/library/dct97kc3.aspx So, my problem is: I have one login page (not use master page), one master page, and hundreds of content page. I check login session Session["loggedInUser"] in master page (if not logged in, redirect to login page) So, when I don't log in, if I type the address of one content page, it must check login session in master page and redirect to login page, right? But it has two cases here: If in content page, I don't use anything related to Session[

A page can have only one server-side Form tag

此生再无相见时 提交于 2019-12-06 14:24:07
问题 i added a page with html code to a master page and i got that mistake when i launched the page. i wonder what i did wrong!??! <%@ Page Title="" Language="C#" MasterPageFile="~/YourGuruMaster.master" AutoEventWireup="true" CodeFile="YourGuru.aspx.cs" Inherits="YourGuru" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"> <style type="text/css"> .style3 { width: 114px; } .style4 { width: 293px; } .style5 { width: 126px; } </style> </asp:Content> <asp:Content ID="Content2"

Highlighting the selected jquery tab using asp.net Master page

空扰寡人 提交于 2019-12-06 11:07:32
I am using jquery tabs(First,Second,Third) in multiple asp.net pages (First.aspx, second.aspx,Third.aspx) in my asp.net website and in each page i am writing the ul,li code. For example in the First.aspx page I am writing the following code inside the 'ul' tag <li class="current"><a href="#First">First tab</a></li> <li><a href="Second.aspx">Second tab</a></li> <li><a href="Third.aspx">Third tab</a></li> Similarly in the second.aspx,Third.aspx pages i am using the Class="current" to highlight the selected tab.Recently we have planned to move to Master pages.So the master page should contain the