master-pages

ASP.Net Masterpage and jQuery creates duplicate content

偶尔善良 提交于 2019-12-11 15:27:48
问题 I have a ASP.Net masterpage with jQuery tabs. I am trying to set it up like this: <div id="tabs"> <ul> <li><a href="Default.aspx">Home</a></li> <li><a href="Settings.aspx"">Settings</a></li> <li><a href="About.aspx">About</a></li> </ul> <div> <asp:ContentPlaceHolder ID="Content" runat="server"> </asp:ContentPlaceHolder> </div> </div> The contentplaceholder's div is inside the tab div to make the jQuery tabs surround the content. Unfortunately, jQuery duplicates all the content of the master

Pass data to Master Page with ASP.NET MVC

不问归期 提交于 2019-12-11 14:54:16
问题 I have a hybrid ASP.NET WebForms/MVC project. In my Master Page, I have a "menu" User Control and a "footer" User Control. Anyways. I need to pass some data (2 strings) to my "menu" User Control on my Master Page (to select the current tab in my menu navigation, etc.) My views are strongly-typed to my data model. How can I push data from my controller to my menu or at least allow my master page to access some data pre-defined in my controller? Note: I understand this violates pure ASP.NET MVC

Master Pages and Postback in ASP.NET

狂风中的少年 提交于 2019-12-11 14:17:36
问题 How can we avoid Master Page from posting back the whole page? 回答1: Just to clarify - the update panel doesn't prevent a whole page postback or a full page lifecycle. It just causes that process to be completed in the background "unseen" to the user. The only difference is that upon completion of the postback only the section wrapped by the update panel declaration is refreshed, thus causing the illusion that only part of the page is posted back. If the trigger control is inside the

Limit JavaScript and CSS files on ASP.NET MVC 2 Master Page based on Model and View content

佐手、 提交于 2019-12-11 14:08:24
问题 I want to include certain .js and .css files only on pages that need them . For example, my EditorTemplate DateTime.ascx needs files anytimec.js and anytimec.css . That template is applied whenever I use either the EditorFor or EditorForModel helper methods in a view for a model with a DateTime type value. My technique: I've put this condition into the <head> section of my master page. It checks for a DateTime type property in the ModelMetadata. <% if (this.ViewData.ModelMetadata.Properties

How to access a top level master page sub from within a nested page?

送分小仙女□ 提交于 2019-12-11 13:06:31
问题 MASTER PAGE STRUCTURE TOP MASTER PAGE MASTER "TopMaster.ErrorMsg(ErrMsg) Here throws NO error" PAGE "TopMaster.ErrorMsg(ErrMsg) Here throws error" I am unable to gain access to the top level class from the base page. TOP MASTER ASPX <asp:Literal ID="litMsg" runat="Server"/> PAGE.VB Partial Public Class BasePage Inherits System.Web.UI.Page Public Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load TopMaster.ErrorMsg(ErrMsg) "Error BC30451: TopMaster is not declared it

css style sheet from content page

ぃ、小莉子 提交于 2019-12-11 12:25:54
问题 Iv'e got a content page with a link to a style sheet which I want to be specific for that page , i.e. I want the design to be specific for that page when it loads and takes its place in the contentplaceholder on the main page. IN MY CONTENT PAGE : <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> <link href="~/Styles/StyleSheet1.css" rel="stylesheet" type="text/css" /> </asp:Content> IN MY MAIN PAGE : <asp:ContentPlaceHolder ID="head" runat="server"> </asp

Get Page owner contact email and display in SharePoint 2010 Masterpage

会有一股神秘感。 提交于 2019-12-11 11:55:55
问题 I've built out a solution with multiple masterpages/page layouts as features for a set of SharePoint 2010 publishing site collections. One consistent request is to be able to grab the page owner contact email and display it in the footer of the masterpage. If the page Contact Email isn't entered, then I need to grab the page owner data from the People Picker, and grab the contact email from that. I don't want to have to add every single publishing page layout to my solution, and manually add

How to call content Page function from Master Page

巧了我就是萌 提交于 2019-12-11 11:35:19
问题 It is necessary to call content Page function from Master Page. Please let me know if more data needed. MasterPage.master.cs looks like protected void Required_Function(object sender, EventArgs e) { // call Update_Content_Page() from content page } Default.aspx looks like <%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <asp:Content ID="Content1" ContentPlaceHolderID="contentPlaceHolder" Runat="Server

Welcome message on Master Page after login

百般思念 提交于 2019-12-11 11:23:48
问题 I have a message name to be showed on MasterPage when the user is logged in. Right now it is showing just MyAccount . Please see the code and let me know how to achieve that. Tried but couldn't managed in the master page. Please see my code as ref:- <div id="nav-right"> <div class="showhide-account"> <img src="images/user.png" width="13" height="13" alt="">  My Account </div> <div class="nav-divider">|</div> <div id="logout"> <a href="Login.aspx" id="logOut" runat="server">Logout</a> </div>

ASP.Net MVC: How can I easily change the tab color of my navigation menu based on the tab that I'm on?

↘锁芯ラ 提交于 2019-12-11 11:18:10
问题 I want to implement my navigation tabs somewhat like the ones on this site, and I've heard that this was built using ASP.Net MVC. If I'm on stackoverflow.com/users, than the "Users" menu tab is orange and all others stay grey, same if a different tab is selected. I am pretty good with manipulating the css to change color when it's hovered or selected, etc, and adding/removing/authorizing items in the menu container, but not familiar with how to change the color of the tab based on the tab