Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Resize ContentPlaceHolder at NestedMaster Page..

Status
Not open for further replies.

mk68

Programmer
Oct 14, 2014
5
MY
Dear All,

In my project i have a master page where i have one content placeholder named as maincontent and i have used this in my nested master page , the main content placeholder is out of my nestedmasterpage size at the left and right side.how i do resize the maincontent place holder in nestedmaterpage as same with size with nestedmasterpage.

Code:
%@ Master Language="C#" MasterPageFile="~/MainSite.Master" AutoEventWireup="true" CodeBehind="AboutSubMaster.Master.cs" Inherits="YtleSolution.AboutSubMaster" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
</asp:Content>


i have tried to use div which gives error[validatation xhtml5 control is not supported outside script or asp:content region]

how to i do resize content-placeholder in nested masted page?

Looking for your valuable reply..


Regards,
Mk..
 
You will have to do it client side. I had to do this in a project and used JQuery to get the size of the container I wanted, AFTER the page is done loading. Then I added the height to the div I needed to the be the same height.
 
Dear Jbenson001,

Thanks a lot for your reply.i understand it .but would be grateful to you if you provide the sample code which really help me to understand more.

looking forward your valuable reply.

Regards,
Mk
 
Something like this:
Code:
    <script type="text/javascript">
        $(window).load(function () {
            //Need to wait for the whole window to load to get the correct height
            //Set the left sidebar height to the full height of the main content.
            var divHeight = $("#mainContent").outerHeight(true);
            $("#theDivToResize").css("height", divHeight);
        })
    </script>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top