master-pages

including jquery menu and jqGrid on the page

I have a navigation menu which I need to include on all my pages....through jsp I just include the that menu <div id="header"><jsp:include page="../menu_v1.jsp"/></div> but problem is that my menu contains <html><head></head><body></body></html> Now when I want to use my jqGrid which is define on my new page inside <script></script>i...

ASP.net access a master page variable through content page

I have a master page: <%@ Master Language="C#" AutoEventWireup="true" Codefile="AdminMaster.master.cs" Inherits="AlphaPackSite.MasterPages.AdminMaster" %> Then I have a public variable: public partial class AdminMaster : System.Web.UI.MasterPage { protected bool blnShowDialogue = false; In my content page I would like to set th...

Porting old pages to use masterpages

I have hundreds of legacy webform pages adding header and footer via a BasePage overriding Render protected override void Render(HtmlTextWriter writer) { RenderHeader(writer); base.Render(writer); RenderFooter(writer); } New pages uses a MasterPage for the default behavior. I would like to know if ...

Make jQuery Ajax Call on Master Page???

Am I missing something? I'm trying to do a simple ajax call using jquery to a web service on my site and I get a 500 error every time when I make the call from the master page. Has no one ever made an ajax call from a master page or am I just crazy and extremely deprived of sleep? Example: MasterPage.master <script type="text/javasc...

change master page <a href link from content page

i have this on my master.page <ul class="menu"> <li class="first" runat="server" id="Li2"> <a runat="server" id="A1" href="../NewEntry.aspx">Create a New Entry</a> </li> </ul> when i go to content page ("NewEntry.aspx") i want the link name to be changed to "Update Entry" <ul class="menu"> <li class="first" runa...

Multiple References to the JQuery Library in a page.

I have an ASP.NET application using a master page. I am adding a reference to the JQuery library in the master page however there are some content pages and user controls that reference the JQuery library directly. Will I need to remove each reference from those pages or can I leave them in place even though I am adding a reference int...

One Hyperlink In Many Different Locations

I'd like to implement a hyperlink in many locations on my website, however I just want to have it defined once not several times over. What is the best way to achieve this? I started down the road of listing it in the node of web.config but I was only able to get that to list as a literal and wasn't successful in having it end up as a...

JQuery: how to get the value of an ID from Master/Content page in ASP.NET

i have this in my content page: but i am getting null value if i try $("#ctl00_cphMaster_CloseButton"). $(document).ready(function() { $("#ctl00_cphMaster_CloseButton").click(function() { jConfirm('Can you confirm this?', 'Confirmation Dialog', function(r) { if (r == true) __doPostBa...

ASP.NET MVC2 Master Page - Server side script not rendering, first bracket being escaped

I have a master page which I am using as a template to allow me to define meta tags per page. My master page takes in a model which contains the meta information, here is an example of what I am trying to do the following: <meta name="description" content="<%= Model.description %>" /> <meta name="keywords" content="<%= Model.keywords %>...

ASP.NET MVC ContentPlaceHolders out of order?

I added a new ContentPlaceHolder (HeadContent) right below the Title so that I can add page-specific css and js files. But when I create a new View using the master page, it puts the default text of the page layout to have the HeadContent open/close tags at the end of the page. Unfortunately, I visually just see it as the first, second a...

Can't find ASP.NET master page

I'm trying to get my content page to be able to access an ASP:Literal on a master page. I have my content page as: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="viewProduct.aspx.cs" Inherits="AlphaPackSite.viewProduct" Title="Hi there!" %> <%@ MasterType TypeName="Main" %> Then my master page called Main.master has: <asp...

How to share code between Pages and Masterpages without multiple inheritance/code duplication?

Hi, I've read the questions/answers explaining that there is no multiple inheritance in C#, that we don't even need it, and that it causes too much problems. Now, I'm working on a project where I don't really understand how can I do things without multiple inheritance, without duplicating code. Here's the situation. There is a website...

ASP.net c# Masterpage problem

I'm trying to make my masterpage work with my content page, allowing the content page to access the master page controls. I get the error: Parser Error Message: The 'mastertype' directive must have exactly one attribute: TypeName or VirtualPath This is on the lines: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="vi...

Localize a MasterPage

I have a MasterPage and some controls in it, I also have a dropdown with languages, I'd like to know if theres is way to localize all of the controls within the masterpage because it doesn't have the InitializeCulture method. Thanks in advance. ...

Custom master page for dialogs

I am using a custom master page for branding, but the way I have designed it makes popup dialogs (like new item for lists) look terrible. I know I could probably change the design to make it work, but that would break the actual page (which for the moment looks perfect just the way it is). My question therefore is this: Is it possible t...

Validating textbox using javascript in MasterPage

Hi, I am using javascript for customValidator to validate textboxes in ASP.Net. The code works perfectly when I am using a normal page, but as soon as I put that inside a MasterPage, the code doesn't work. Below is the code for my aspx page. If I put this code inside a MasterPage it doesn't work. Could you guys advise me how to make th...

How to dynamically change master page's master page?

I am trying to change the master page dynamically, and although it's easy to do from a content page (overriding OnPreInit), there is no such event for a master page. Is it possible to introduce this event somehow? UPDATE: I got halfway there by going via the PreInit of the pages at the bottom of the ladder, turns out you can do things ...

Cannot programmatically load custom controls from parent master page to child master page

I am trying to apply a set of custom controls to a master page via code-behind during Page_Load, initializing the class and using Page.Header.Controls.Add(). I have another child master page between the parent and the content and this child master references directly in its own code a javascript file which calls a jQuery function (.ready...

Can ReSharper properly parse SharePoint layouts?

I am creating a SharePoint 2010 feature in Visual Studio 2010. While ReSharper is a valuable tool for writing code, it reports lots of errors (all server-relative image references, master page reference, ContentPlaceHolderID's referring to the master page and so on) in .aspx layout definitions. I had to exclude the master page from ReSha...

How to find control within ContentPlaceholder and placeholder?

I am adding controls dynamically to PlaceHolder which within ContentPlaceHolder var t = (ContentPlaceHolder)Master.FindControl("ContentPlaceHolder1"); var t1 = (PlaceHolder)mpContentPlaceHolder.FindControl("PlaceHolderName"); var t2 = (DropDownList)t1.FindControl("ControlID"); It looks like I am missing something because t2 is always...