Click here to Skip to main content
15,888,113 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: debugging java script in asp.net Pin
meeram39523-May-11 6:27
meeram39523-May-11 6:27 
QuestionVS2010 Express, no MSSQL? Pin
Helfdane20-May-11 9:28
Helfdane20-May-11 9:28 
AnswerRe: VS2010 Express, no MSSQL? Pin
AspDotNetDev20-May-11 9:51
protectorAspDotNetDev20-May-11 9:51 
GeneralRe: VS2010 Express, no MSSQL? [modified] Pin
Helfdane20-May-11 9:57
Helfdane20-May-11 9:57 
GeneralRe: VS2010 Express, no MSSQL? Pin
AspDotNetDev20-May-11 10:55
protectorAspDotNetDev20-May-11 10:55 
GeneralRe: VS2010 Express, no MSSQL? Pin
gavindon20-May-11 11:29
gavindon20-May-11 11:29 
GeneralRe: VS2010 Express, no MSSQL? Pin
Luc Pattyn20-May-11 14:52
sitebuilderLuc Pattyn20-May-11 14:52 
QuestionOverwrite Masterpage Content In Page Without Redefining Content in Sub-Masterpage Pin
AspDotNetDev20-May-11 8:25
protectorAspDotNetDev20-May-11 8:25 
When you create a ContentPlaceHolder in a masterpage, you can place some default content in it and then you can overwrite that content in a subpage or sub-masterpage. However, if you try to overwrite that content in a subpage of a sub-masterpage of the masterpage, you get an exception ("Cannot find ContentPlaceHolder 'body' in the master page '/SubMaster.master'"). You can fix this by copying the content in the masterpage and putting it in the sub-masterpage. However, that then requires that any change done to the masterpage also needs to be done to the sub-masterpage. I am curious if there is a way to avoid that. As an example, suppose I have this masterpage:
ASP.NET
<%@ Master %> <%-- MainMaster.Master --%>

<html>
<head runat="server"><title></title></head>
<body>
    <asp:ContentPlaceHolder runat="server" ID="body">
        <p>MainMaster text.</p>
    </asp:ContentPlaceHolder>
</body>
</html>

It defines the "body" ContentPlaceHolder. Then I have a sub-masterpage:
ASP.NET
<%@ Master MasterPageFile="~/MainMaster.Master" %> <%-- SubMaster.Master --%>

<asp:Content runat="server" ContentPlaceHolderID="body">
    <asp:ContentPlaceHolder runat="server" ID="body">
        <%-- I have to redefine the same content here... I want to avoid that. --%>
        <p>MainMaster text.</p>
    </asp:ContentPlaceHolder>
</asp:Content>

I then have two pages that use that sub-masterpage. The first one overwrites the ContentPlaceHolder:
ASP.NET
<%@ Page MasterPageFile="~/SubMaster.master" %> <%-- Page1.aspx --%>

<asp:Content ID="Content1" ContentPlaceHolderID="body" runat="server">
    <p>Page 1 text.</p>
</asp:Content>

The other page inherits rather than overwriting the ContentPlaceHolder:
ASP.NET
<%@ Page MasterPageFile="~/SubMaster.master" %> <%-- Page2.aspx --%>

<%-- This will get the same content as MainMaster. --%>

The real web application uses a much more complicated setup than this example, so I'm not looking for suggestions like "just get rid of the sub-masterpage". What I'd like to know is if there is a way to make that content from MainMaster propagate down to Page1 and Page2 without redefining the same content in SubMaster while allowing Page1 to overwrite the content and Page2 to keep the content intact. Note that the content in MainMaster may itself have some ContentPlaceHolders, so using a user control to contain the content isn't a workable solution.

QuestionUploading Large files to Server using Asp.Net Pin
Paul McGann20-May-11 2:45
professionalPaul McGann20-May-11 2:45 
AnswerRe: Uploading Large files to Server using Asp.Net Pin
David Mujica20-May-11 4:39
David Mujica20-May-11 4:39 
GeneralRe: Uploading Large files to Server using Asp.Net Pin
Paul McGann20-May-11 4:42
professionalPaul McGann20-May-11 4:42 
AnswerRe: Uploading Large files to Server using Asp.Net Pin
Herman<T>.Instance22-May-11 23:30
Herman<T>.Instance22-May-11 23:30 
QuestionPlease help me !!! Pin
HeartsFrozen19-May-11 22:21
HeartsFrozen19-May-11 22:21 
AnswerRe: Please help me !!! Pin
sudeshchandram20-May-11 0:19
sudeshchandram20-May-11 0:19 
AnswerRe: Please help me !!! Pin
Shameel20-May-11 1:30
professionalShameel20-May-11 1:30 
AnswerRe: Please help me !!! Pin
RichardGrimmer20-May-11 3:22
RichardGrimmer20-May-11 3:22 
AnswerRe: Please help me !!! Pin
Not Active20-May-11 4:28
mentorNot Active20-May-11 4:28 
AnswerRe: Please help me !!! Pin
koolprasad200320-May-11 18:27
professionalkoolprasad200320-May-11 18:27 
AnswerRe: Please help me !!! Pin
HeartsFrozen22-May-11 23:10
HeartsFrozen22-May-11 23:10 
QuestionJava script in client level Pin
padmanabhan N19-May-11 22:16
padmanabhan N19-May-11 22:16 
AnswerRe: Java script in client level Pin
Anurag Gandhi19-May-11 22:55
professionalAnurag Gandhi19-May-11 22:55 
AnswerRe: Java script in client level Pin
scy27875351719-May-11 23:00
scy27875351719-May-11 23:00 
AnswerRe: Java script in client level Pin
Shameel20-May-11 1:34
professionalShameel20-May-11 1:34 
Questionremove blank space in page footer in crystal report Pin
Athira.G.Krishnan19-May-11 20:05
Athira.G.Krishnan19-May-11 20:05 
AnswerRe: remove blank space in page footer in crystal report Pin
Shameel20-May-11 1:35
professionalShameel20-May-11 1:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.