MVC :: Putting Asp Page Into Contentplaceholder?

Apr 24, 2010

I'm incorporating some parts of an old asp application into a newly written mvc app. In most places I've separated out the data access and business logic into the model, and written new view's and viewmodels on the mvc side, although what I ended up with was not perfect, it works reasonably well.There's one area that's probably a bit too much work to do that. It uses an asp treeview and custom controls, and has lot's of code that just isn't partitioned very well. It's one of those 'well I wouldn't start here' situations, but unfortunately it's the code I have. As an application in it's own right it works well and has done for the past 5 years or so. Although it does want re-writing, that's probably more work than I wanted to do right now if I can get away with it.

The asp pages decend from a custom asp page, which itself decends from asppage and contains a custom DAL. What I'd really like to do, is 'paste' the page produced by this legacy asp page into the 'main' contentplaceholder area on an mvc form. I know I can incorporate standard asp pages into an mvc application, but that isn't what I'm trying to do as I want to use the master page from the mvc application.

View 2 Replies


Similar Messages:

Master Page Needs To Know If A ContentPlaceHolder Hasn't Been Used By Current Content Page?

Aug 13, 2010

I have a master page which has several ContentPlaceHolders. Not all of them are used by the current content page all the time. During page rendering the master page needs to set a property when a ContentPlaceHolder wasn't used by the current content page. Meaning a ContentPlaceHolder might not be referenced by the content page.What's the best way for the master page to iterate through its ContentPlaceHolders and find out which ones haven't been used by the current content page? Looking for a solution that does not involve any communication from content page to master page.

View 2 Replies

Web Forms :: Putting A Control On An Aspx Page And Double-clicking In Design View To Create VB Page?

Apr 22, 2010

I've always depended on putting a control on an aspx page and double-clicking in design view to create my VB page. But this isn't happening in my current project. It creates an inline script in my aspx page instead. Where is the option or preference or XML file or.... that controls this?

View 5 Replies

Putting MVC Into A WebForms Page?

Nov 22, 2010

Is there any way to render a normal view of asp.net MVC action onto an old .aspx WebForm using an MVC helper or some other method?

View 3 Replies

Web Forms :: See All The Content Of The Page In The ContentPlaceHolder?

Jan 14, 2010

i copied the html code from an aspx page from the tag <form> all the way down and paste it in the sorce of aspx page that bind with the MasterPage. now on the design view i need to see all the content of the page in the ContentPlaceHolder. it worked for 2 pages but in the thired page as i paste the html code the ContentPlaceHolder didnt reshaped itself to page size in the design its like spred all over the page. i'm working with visual studio 2005 asp.net c#

View 1 Replies

Conditional ContentPlaceHolder In Master Page?

Jun 24, 2010

I have two master pages in my project, one for web views and another for emails. In the web master page is a placeholder to put page specific JavaScript, if a page is using this and I try to programmatically change the masterpage to send as an email the server falls over as it can't find the placeholder.

Is there a way to change the behaviour so that if a placeholder can't be found it just doesn't include that bit? I'm thinking maybe on my page base class looping over a collection of placeholders and content tags and removing the ones that don't match up, but I'm not sure if there's a good point in the page lifecycle to do this.

I'm using MVC not WebForms if this makes a difference.

View 2 Replies

Contentplaceholder Of Master Page In Table?

Jan 13, 2012

I'm designing a website and i want to use 3 columns on the master page,left center and right.I want to create each column with a table so we have table1-left column, table2-center column and table3-right column.On an inherited page i would like to created div's,span's etc.So the question is where exactly do i put the contentplaceholder of the master page?Do i need 3 contentplaceholders one for each table?Also the contentplaceholder would be inside a table a tr or a td?

View 5 Replies

Web Forms :: How To Define Metakeyword In A Page With Contentplaceholder

Nov 24, 2010

I have a page which is linked with masterpage.

In my masterpage i have already defined metakeywords and description. But for one of my page i would like to define metakeywords and description which will be for that page only.

The metakeywords and desciption defined in master page is for the website.

Where and How to define metakeywords and desciption for any page which doesn't have <head> tag as it is linked with masterpage.

This is my About.aspx page code :

<%@ Page Language="C#" MasterPageFile="~/MasterPages/OneColumn.master" AutoEventWireup="true"
Inherits="Web.AboutPage" CodeBehind="About.aspx.cs"
%>
<%@ Register TagPrefix="MyTag" TagName="Topic" Src="~/Modules/Topic.ascx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cph1" runat="Server">
<nopCommerce:Topic ID="topicAbout" runat="server" TopicName="About">
</nopCommerce:Topic>
</asp:Content>

View 3 Replies

Web Forms :: Put Two Different ContentPlaceHolder From Two Different ASPX Page In One MasterPage?

Mar 18, 2010

is it possible to put two different contentPlaceHolder from two different ASPX page in one MasterPage? Just like iFrame? if not what asp.net process/control can?

View 3 Replies

Web Forms :: Resizing ContentPlaceHolder In Master Page?

Aug 17, 2010

As the first step, I designed a Master Page for my website. Everything seems to be in order. My master page has a table say "Mytable" with 2 rows.

In the first row, I've put up a banner for the website.

In the second row, I want to place the ContentPlaceHolder.

The thing is that I can't make the ContentPlaceHolder to occupy the whole cell. I tried finding the solution through search engines and could not find out a solution.

In my web page, I want to create a table by Javascript. I mean that I want to make this table to occupy the second row of "Mytable". There is still some gaps left at the top and bottom of the ContentPlaceHolder.

View 5 Replies

C# - Access Properties From Page In ContentPlaceholder In MasterPage?

Feb 10, 2011

I have following environment:

masterpage with a contentPlacholder multiple pages which use this masterpage and implement a base-class (fooPage) fooPage has a certain property (fooProperty)

[Code]....

Obviously this is not going to work - but how can I achieve this?

I know the alternative: call a method from the masterPage in the contentPage with fooProperty as a parameter - but i would like to rather have a pull-system in this case...

View 2 Replies

Web Forms :: How To Get Gridview In Master Page Which Is Placed In ContentPlaceHolder

Jul 31, 2012

Looking to have a export button in master page. Gridview is placed inside panel, so I couldn't get the gridview to export to excel. I have gridview's wherein I can able to export to excel that are directly placed in maincontent (Content PlaceHolder). The problem is if gridview is placed inside panel I couldn't export.

protected void LinkButtonExport_Click(object sender, EventArgs e) {
foreach (Control ctr in MainContent.Controls) {
GridView gv = ctr as GridView; if (gv != null)
{ ExportUtil.Export("Test.xls", gv);
} else {
LinkButtonExport.Enabled = false; }
}}

View 1 Replies

Web Forms :: Creating Content For Each ContentPlaceHolder Of Master Page

Apr 13, 2010

I am searching the internet for possible solution for my problem, I have a page that sets the master page at runtime, my problem is how to create a content (asp:Content) control for each of contentplaceholder (that exists at design-time) in each masterpage?? I am looking at AddContentTemplate, but seems not working...

View 2 Replies

Web Forms :: When Clicking On A Link Would Like The Linked Page To Appear In The Contentplaceholder?

Jun 23, 2010

I have a masterpage that has a banner and under the banner it has a few links...The issue i am having is when clicking on a link i would like the linked page to appear in the contentplaceholder, i can't seem to figure it out.

View 3 Replies

Putting Javascript Source Then Immediately The Page Not Working?

Jun 15, 2010

When I put the following code on my page.

<script type="text/javascript" src="../../Scripts/jquery-1.4.1.js" />

Then anything below will became nothing.

View 7 Replies

Putting Google Adsense Javascript On A Content Page Of A Masterpage?

Apr 27, 2010

I am trying to put google adsense on my default.aspx that has a masterpage. I am not sure I am doing it correctly. Is there a particular place I should be pasting their java script ?

View 7 Replies

Web Forms :: Display Menu Item Data On Separate Contentplaceholder On Same Page?

Jan 24, 2011

I have a aspx page with 3 contentplaceholders.

In contentplaceholder1, i have a menu with submenu items.

I need a functionality by which whenever i hover on any menu item or select any item it should display repective content in the contentplaceholder2

View 8 Replies

Web Forms :: Accessing Control Name Inside A Contentplaceholder In Master Page Using Javascript

Apr 26, 2010

I have a asp.net webpage which is using an Master page and contentplaceholder.

My Req: I want to access the control name through javascript.I have tried to use 'document.forms[0].elements[i].name' but its giving an error since my page there is no form.Only master page and contentplaceholder.

View 1 Replies

MVC :: Putting Partial View Values On A Parent View / Page?

Feb 11, 2011

I have a partial view that is rendered on a view. That partial view has textboxes in it. The user can enter values into them.

I need to put all the values from the textboxes in my partial view into an array, and then give the view (the parent page rendering that partial view) access to that array.

View 6 Replies

How To Fill A ContentPlaceholder To 100%

Feb 21, 2010

The layout on the page is supposed to be a 200px column on the left, and the right column fills the rest of the screen

So I have my two content placeholders in there, but for the life of me I cant seem to get the right one to just expand to fill the container

- container is 100% x 600px (so fills to browser width, 600px in height)

- inside that, the left and right cols float left

- Left col width: 200px, margin-right:20px

- Right...? If I give it 100% it truncates to a new line...

View 4 Replies

How To Refresh Only ContentPlaceholder

Mar 25, 2011

I am developing a website. I have used Master Page and i have created left menus dynamically. When i Click on that menus(For displaying a another page). I want to refresh only contentPlaceholder. Here i have used Update Pannel But its wont work.

View 3 Replies

C# - Get Div Control In ContentPlaceHolder?

Nov 12, 2010

I've created very simple web site for the test purpouses. Only one master page and one content page.

My content page looks like this:

<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div id="TestDiv1">bla bla</div>
<div id="TestDiv2">ble ble</div>
</asp:Content>

Now, basing on some condition I would like to show/hide a given div. So I am trying to reach one of those divs by Controls collection, like this:

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
ContentPlaceHolder myContent = (ContentPlaceHolder)this.Master.FindControl("ContentPlaceHolder1");
myContent.FindControl("TestDiv1").Visible = false; //this is not working
}
}
}
}

But the above example is not working. None of the two div control exists in the myContent.Controls collection. If I place for example a TextBox on my content page, I can reach it through Controls.

So what should I do to be able to access the div control?

View 2 Replies

Getting Contents Of ContentPlaceHolder Within C#?

Jun 30, 2010

I've got a Master Page with multiple ContentPlaceHolders. One of them will sometimes be empty. If they both have content, I'd like to make visible a buffer so there is some space between them, but this should remain hidden otherwise.My question is, how can I determine from the C# code-behind of my Master Page whether the ContentPlaceHolder of a child page has any content assigned to it?

View 3 Replies

Open Pdf Within Iframe In Contentplaceholder?

Apr 26, 2010

im working with asp.net 2.0 and im using master pages.i have a link to a pdf file...when i click on the link i want the pdf to open within the contentplaceholder.im using iframe within the content placeholder.my master page code is below:

[Code]....

i want the citizen_chart.pdf to open within the iframe....the other links open in the content placeholder. each of the other pages reference the master page,so all the links are seen in every page.so whenever i click on the citizen charter lik the pdf should open in the iframe within the contentplaceholder.

View 3 Replies

Web Forms :: Display ContentPlaceHolder Top Of TD?

Mar 12, 2011

In my master page I have a table, a row and 2 TD. In first TD of a row i have <li> and in another TD i have
ContentPlaceHolder.

My problem is ContentPlaceHolder is displaying in the middle of TD and i want to display it on the top of TD.

My code is as below

[Code]....

View 2 Replies







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