Why User Control  is not displaying  inside the Table and Content Controls

KavyaVS
KavyaVS used Ask the Experts™
on
I created a footerPage.ascx user control for footer content of .aspx page.I am registering it in page which is using content and Table controls.

I registered the user control in page by <%@ Register TagPrefix="ctr" TagName="Footer" Src="../footerPage.ascx" %>.
Markup:
<asp:Table>
<asp:TableFooterRow>
 <asp:TableCell>
 <ctr:Footer ID="FtrPage" runat="server"  />
   </asp:TableCell>
</asp:TableFooterRow>
</asp:Table>
</asp:content>

The user control is displaying outside the Table and User Control.
I want to display it exactly where it is in Markup.

Please any suggestions.

Thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2009
Commented:
This worked for me.

<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
	CodeBehind="Default.aspx.cs" Inherits="WebTest._Default" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
	<%@ register tagprefix="ctr" tagname="Footer" src="MyControl.ascx" %>
	<h2>
		Welcome to ASP.NET!
	</h2>
	<asp:Table runat="server">
		<asp:TableFooterRow>
			<asp:TableCell>
				<ctr:Footer ID="FtrPage" runat="server" />
			</asp:TableCell>
		</asp:TableFooterRow>
	</asp:Table>
</asp:Content>

Open in new window

Top Expert 2009
Commented:
Were you able to try this? Let me know if you're having any issues.

Author

Commented:
Hi nmarun,
The body content in scrollable div.
<div class="scroll">
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
      <%@ register tagprefix="ctr" tagname="Footer" src="MyControl.ascx" %>
      <h2>
            Welcome to ASP.NET!
      </h2>
      <asp:Table runat="server">
            <asp:TableFooterRow>
                  <asp:TableCell>
                        <ctr:Footer ID="FtrPage" runat="server" />
                  </asp:TableCell>
            </asp:TableFooterRow>
      </asp:Table>
</div>
</asp:Content>


.scroll {
height: 30px;
overflow: auto;
border: 1px solid #666;
padding: 8px;
}
If I want to see the vertical scrollbars the FtrPage is not coming inside the div and content.
It is displaying outside of it.
If without scrollbars it's fine.

How to display the usercontrol inside the div. Pls See the css class.Any suggestions please.

Thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial