master-pages

What should I know before converting content pages to nested master-content pages in .net?

Hi There, 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 need...

how to assign a class to one of the <li> in master page through c# from child page?

Hi, I have a master page with a bunch of menu like: <ul id="ulMenu" runat="server"> <li id="A"> <li id="B"> <li id="C"> ..and so on .. </ul> and i have a function in master page which i call from child pages, like: Master.setCurrentMenu("A"); and in the SetCurrentMenu() of the Masterpage, since I have my < UL > se...

Attribute.Add on MasterPage <body> tag

I'm attempting to put some javascript into the body tag of my masterpage using the following techinique: <body id="pgBody" runat="server"> //Property to get the body tage in MasterPage.cs public HtmlGenericControl BodyTag { get { return this.pgBody; } } //In my content page PageLoad() MasterPage mstrPg = this.Mas...

Master Page and Child Page concept!

I have a aspx web page. if i change something in the page and when it refreshes , does it load just the child page or even the master page?? What function one should use to refresh Master page as well!! I hope i am clear!!! Thanks guys! ...

Accessing .Text property in a Master Page from the Master.cs

Hello guys, I have a textbox and a button, and I trying to give the user a search option in the master page. The onClick event of my button is fine, but the textbox.Text property is always empty. I googled a little and fine many articles about accessing the Master from the ContentHolder, but I believe its no my case... Help apprecia...

Is it possible to share a Master Page between projects?

We have several different MVC2 projects on the go and I would like to be able to share a single master page between them. Is there an easy way to do this without recreating the same master page in each project? ...

How to Inject HTML on ASP.NET MVC master page

I have a simple, but probably common problem on how to inject HTML inside an ASP.NET MVC master page. I have a google analytics tracking code that sits on my master page. The code looks like this: var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-XXXXX-1']); _gaq.push(['_trackPageview']); // need to inject ecommerce code here (functi...

How to know that we come to a page after redirecting from another page.

I'm using a single page for two different purposes. By default it has one behavior and on coming to same page after redirecting via a link button it has a different behavior, like changing master page, etc... How can I detect this and change the behavior accordingly? ...

Help with asp.net mvc and ViewData in MasterPage

In order to avoid having to pass Data that goes in the master page of my site before every view in every controller I have created an ApplicationController that sets the data on its constructor... the problem with this approach is that one of the viewdatas I must pass is the url of the profile Image of the current logged in user. [Autho...

Calling method on Master page from WebMethod

Or any viable workaround. So, imagine a Master page that implements IFooMaster with a method ShowFancyMessagePopupTheBusinessCantLiveWithout(string message); I am in a page that inherits this master page. Upon a checkbox being unchecekd, I want to show a message to the user that if they save it, they can't re-check the checkbox without...

What am I doing wrong in ASP.NET

Here is my master page code behind: namespace mysite.MasterPages { public partial class Main : System.Web.UI.MasterPage { public bool isLoggedIn; protected void Page_Load(object sender, EventArgs e) { isLoggedIn = Request.IsAuthenticated; // Is the user currently logged in } ...

How to use a MasterPage on a MobilePage

Although MSDN says the MobilePage.MasterPageFile property prevents master pages from being used, I've seen people talking about using master pages on their mobile pages. Can someone show me an example of a MasterPage being used in a MobilePage? If it really is not possible, I'd like to know what the people on the asp.net forum were tal...

Why can't I reference JavaScript files in my View?

My JS works when I reference it in the MasterPage, and it works when I reference it in a Partial View (.ascx), but not when I reference from the View (.aspx). Any ideas why? ...

Problems using the '#' to identify tags in a master/content/css page combination

I want to separate the design and implementation of my web pages into a separate HTML and CSS files (for easier maintenance). I have the following Page defined in a project. <%@ Page Title="" Language="C#" MasterPageFile="~/STGGeneral.Master" AutoEventWireup="true" CodeBehind="Register.aspx.cs" Inherits="SystemManager.Register" %> ...

syntax for layouit using DIV + CSS?

How can I get a master page for asp.net with 3 sections using divs to split the window into a left pane for a tree view navigation. The main window to the right will be divided into a banner type top div and a main window div under it for the main content window where I want child pages loaded in the master page implementation. can some...

asp.net master pages, content pages

i have a master page with three sections, left pane + 2 right panes (one top header and one main screen area) i want to have the main screen area dynamically fill a url based on a link click from the top header pane. so in the header if i have three links - assume i have three pages (one.aspx, two.aspx, three.aspx) and i want to click ...

ASP.NET master page vs. SharePoint page layout template

A client of mine uses SharePoint to manage its websites, and recently asked me to build a small website for them using ASP.NET, which they would then implement via SharePoint. My skills with ASP.NET are intermediate, and I have no experience at all with SharePoint. I created a master page for the site, as well as the individual pages, ...

ASP.net master page not executing

Hi all, I have a master page, and a content page. The master page however doesn't appear to be executing any of the page load code I have defined, when I build it I get no errors or warnings. Here is my master admin page: <%@ Master Language="C#" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11...

What causes " Controls collection cannot be modified because the control contains code blocks"?

I recently put some code <% %> code blocks in my Master Page. Note I've read of the "fix" for either moving things out of <head> or using <%# %> but neither of them work well for my application. Now the weird thing is that I only get this error on one page of mine. All the other pages seem to work fine, so what actually causes this err...

Change web site theme for client from MaterPage

I need to change website theme (css) by clicking button on Master Page. protected virtual CSSClick (_sender : object, _e : System.EventArgs) : void { //Session("Theme") = "Advanced"; } Google & MSDN didn't gave me the answer :( So no matters on C# or VB.NET , just how to make it ? thank you. ...