C# - Use The Same Content Page With Two Different Master Pages ?

Feb 15, 2010

I have an asp.net content page which is used inside of a master page (with header, menu and some links). I would like to reuse it in a different context without the master page (to not display the header and menu there), or with an empty master page if this is somehow possible. I don't want to violate DRY principle by taking the whole page and creating a standalone clone of it for obvious reasons. Is this somehow possible ?

View 2 Replies


Similar Messages:

C# - Master Page Which Wraps The Content Pages Content In The Form, Can't Nest The Forms?

Oct 5, 2010

The WorldPay payment gateway suggests using this HTML to take the customer to the payment page:

<form action="https://select-test.wp3.rbsworldpay.com/wcc/purchase" name="BuyForm" method="POST">
<input type="hidden" name="instId" value="211616">
<input type="hidden" name="cartId" value="abc123">
<input type="hidden" name="currency" value="GBP">
<input type="hidden" name="amount" value="0">
<input type="hidden" name="desc" value="">
<input type="hidden" name="testMode" value="100">
<input type="submit" value="To Payment!">
</form>

How to I put this form on my page? The problem is I have a master page which wraps the content pages content in the ASP.net form, I can't nest the forms.

View 2 Replies

How To Add Title And Meta Tags For Content Pages In A Project Base On Master And Content Page

Oct 17, 2010

how can i add title and meta tags for content pages in a project base on master and content page(dinamically) ?

i used the blow method for master page :

[code]....

and the error is :(in line *)

Error 17 'System.Web.UI.MasterPage' does not contain a definition for 'SetMetaTags' and no extension method 'SetMetaTags' accepting a first argument of type 'System.Web.UI.MasterPage' could be found (are you missing a using directive or an assembly reference?)

View 3 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

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

Web Forms :: Multiple Master Pages For One Content Page?

Jan 25, 2010

Can we use 2 master pages in a single content page without nesting master pages.

View 1 Replies

Web Forms :: How Can Use Master Page Methods Into Content Pages

Mar 23, 2010

I have some of the methods in the master page,I want to inherit the master page to content page and use its methods...How will be able to do that..Do we have some techniques with inheritence?Please specify the techniques andPlease in C# with Code Behind...

View 4 Replies

Web Forms :: How Many Master Pages Can Be There For A Single Content Page

Mar 10, 2011

Can any one tell me :- How many Master Pages can be there for a Single content page at max?Describe with details why is so also .

View 1 Replies

Web Forms :: Interaction From Nested Master Pages To Content Page

Apr 12, 2010

I have 2 nested master pages, lets call them MP1 and MP2. MP1 is top level, MP2 is level

2. Then I have several content pages. Lets say I have 2 content pages for now CP1 and CP2. Each content page has a form that will have some user input and a SaveData()function that saves the data to a database. Each content page also has a "Save" button that calls the SaveData() function.

MP1 and MP2 have several link buttons. The functionality I need is this: Any time a user clicks on a link button in MP1 or MP2, the SaveData() function of the currently loaded page should be called. This is to save the data even if the user forgets to click the "Save" button before leaving the page.

So far I can do this from the link buttons in MP2. I followed the master pages tutorial # 7

In the .cs file for MP2, I declare:

public event EventHandler SaveData;

then i raise a "SaveData" event any time a link button in MP2 is clicked.in every content page (CP1, CP2 etc.) aspx file, I have Master Type directive to assign the Master Page to MP2.

in CP1, CP2 etc .cs file, i have the following code:
protected void Page_PreInit(object sender, EventArgs e)
{
//wire up the SaveData event from MP2 to Master_SaveData function in this page.
Master.SaveData += new EventHandler(Master_SaveData);
}
private void Master_SaveData(object sender, EventArgs e)
{
//when the MP2 SaveData event is raised, save the data in this page.
SaveData();
}

All of this works fine.Problem is I am not able to do a similar thing from MP1.What I have tried so far is to raise an event in MP1 that is handled in MP2. When the event is handled in MP2, it raises the SaveData event to be handled in the page. The event in MP1 is null and hence never raised.

View 5 Replies

MVC :: Master Page Is Executed Before Content Pages Controller/action?

Mar 24, 2011

I think normally the execution sequence is content page's controller first, then master page (I have some inline code).

But now I have a situation that master page's inline code is executed before content page's controller.

View 2 Replies

Web Forms :: Access Master Page Controls In Content Pages?

Dec 17, 2012

Today I got a strange problem,that is I am unable to access master page controls in its code behind,I am wonder because,I can able to access master page controls in their code behind of other projects/applications's master pages.

I know we can acess like this Label lblText = (Label)this.FindControl("lbluserName"); in that situation but I need to access div controls which are set to run at server.

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

VS 2010 - Content Page Accessing Event Handlers From Two Different Master Pages

Jul 1, 2013

I have a ASP.NET content page where the master page is set dynamically. Both master pages contain a print button and an associated event handler for the click event of the button. Unfortunately I receive a run-time error when I attempt to dynamically access the event from the master page that was not initially assigned. Below are code snippets:

Page_Load():
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim strPageTitle As String = "Evaluator Data Form - Instructions"
If Page.MasterPageFile.Contains("masEvaluators.master") Then
Dim mp As Evaluators_masEvaluators = CType(Me.Master, Evaluators_masEvaluators)

[code]....

which produces the following error when I load the page and reference the "masStaff.master" master page:

System.InvalidCastException: Unable to cast object of type 'ASP.staff_masstaff_master' to type 'Evaluators_masEvaluators'. at Evaluators_EDF_Instructions.Page_Load....

I can solve the problem by adding a print button to the content page, but that defeats the purpose of using a master page.

View 1 Replies

Web Forms :: Declare Global Variable In Master Page And Use It In Content Pages

Jun 16, 2015

how to declare global variable in master page and use it in all pages

View 1 Replies

AJAX :: How To Add Accordion CSS File In Content Page When Working With Master Pages

Apr 25, 2013

i want to apply css on accordion control but since the page where i m using is already associated with master page...

when i go to my website page..i use attach style sheet and then ok..but style sheet doesn't get attach...how should i do that..?

View 1 Replies

Web Forms :: Show Main Body Content With All Individual Pages Contents Using Master Page?

Nov 23, 2013

I want to show a panel with image at the body part of the master page with all other web pages..

View 1 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

Master Pages - Content Web Form - Content From Placeholder Disappears

Apr 9, 2010

I'm attempting to set a class on the body tag in my asp.net site which uses a master page and content web forms. I simply want to be able to do this by adding a bodycssclass property (see below) to the content web form page directive.

It works through the solution below but when i attempt to view Default.aspx the Content1 control loses its content.

Here is how I'm doing it. I have a master page with the following content:

[code]....

View 2 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

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

JQuery Undefined In Content Page When Using Master Pages Which Has JQuery Reference?

Jul 19, 2010

I have a nested master page. A parent master page, a child master page and a content page whose master page is the child master page. I have a reference to jQuery in the parent master page in the head section.<script type="text/javascript" src='<%#ResolveUrl("~/includes/jquery-1.4.2.min.js") %>' ></script> & Page.Header.DataBind(); in the OnLoad event.

I am using jQuery in all the pages including the master pages. However I am getting "Error: $().ready is not a function" in the content page. If I include jQuery reference in the content page it works. Question: If the reference to jQuery is in the master page head section, why aren't the content pages able to use jQuery? When I do view source, the script tag with jQuery is there and it works. The master pages and content page are merged during rendering and sent to the browser as a single html page so I am not sure when master pages are used, jQuery references break.

UPDATE:

When I changed '$.ready(function()' to 'jQuery(document).ready(function($)' it worked! I am not loading any other javascript libraries and I am not using MS Ajax.

View 1 Replies

Web Forms :: Master / Content Pages And Postback

Aug 15, 2010

If I go to a content page on my website and enter some data into a textbox, then BEFORE I move focus from that control I press ENTER on the keyboard, the page_load event registers a postback event which in turn passes control to the Master page's page_load event where another postback=true is registered and THEN control goes to the first button on the Master page which is HOME, and then incorrect processing results. Autopostbacks are set to False on the textboxes. If I do not key data into any textbox and press ENTER on the keyboard, I correctly stay within the form

If I use the mouse or tab to navigate thru the textboxes, fill them in and press the Submit button, everything works fine. I cannot see why entering data into the textboxes triggers this action, and even so, why control does not return but instead gets 'lost' on the Master page.

View 1 Replies

Web Forms :: Default Button In Master And Content Pages

Oct 27, 2010

I use VS2K8 to develop a web app. In master page, i have a search textbox and search button. the content page also has texboxes and a submit button.

1. In this case, every time I hit {Enter} the search button is fire but i want submit button fire

Master.cs Page_Load()
Page.Form.DefaultFocus = textboxSearch.UniqueID;
Page.Form.DefaultButton = btnSearch.UniqueID;
Content.aspx.cs Page_Load()
Page.Form.DefaultButton = btnSubmit.UniqueID;

2. In this case, every time I hit {Enter} the submit button is fire but i want search button fire

Master.cs Page_Load()
Page.Form.DefaultFocus = textboxSearch.UniqueID;
//Page.Form.DefaultButton = btnSearch.UniqueID;
Content.aspx.cs Page_Load()
Page.Form.DefaultButton = btnSubmit.UniqueID;
>>> So how do I make it fire the right button by hit {enter} when the related textbox is focus

View 2 Replies

Web Forms :: Shared Same Content File With Two Master Pages

May 18, 2010

I just want to ask something about master page. My requirement is that I want to use two master pages like different banners and want to share for same content page for easy maintenance purpose. Master Pages will be changed depend on login users.

View 2 Replies

Web Forms :: Use Arrays Declared In Master.cs In Content Pages?

Dec 10, 2010

I am declared the following arrays in Master.cs file

[Code]....

Now how do I use these arrays in my content page files.

View 2 Replies







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