Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 14th, 2008, 04:02 AM
Registered User
 
Join Date: Aug 2008
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem with Register.aspx

Hi Guys,

Sorry if this is simple to some of you guys but i'm fairly new to c# and .NET. I'm a little stuck on Chapter 4, page 162. I have created the register.aspx page and it all works well except when i run it the screen does not expand on the second section "set-up your profile". I've been looking at the full download version to see where i may have missed something but cant find anything.

So when my website loads the second part of this register.aspx it cuts it in half with the footer, instead of pushing the footer down. Any ideas what i have missed?

Thanks.



 
Old August 14th, 2008, 05:01 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 143
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi,

It's hard to say without actually seeing your aspx code. It could be as simple as a tag that is unclosed, but unless you could post your markup, it'll remain a guessing game.

Try copy and paste it here, and I can see at home if I can compare it to my version and spot the difference. Alternatively, you can always try to download a text-comparison tool like "ExamDiff", and load the downloaded version as well as your own version in there to see where the files do not match.

HTH.

http://entropia-online.blogspot.com/
 
Old August 14th, 2008, 05:09 AM
Registered User
 
Join Date: Aug 2008
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi VF,

I tried copying the downloaded text straight into the register.aspx file and the same thing happens. I have tested the download version and it works fine ha.

I have a feeling it may be something to do with the masterpage which holds register.aspx? What you reckon? I didnt try copying that text into my project as it has a lot of code that i have not go to yet in the book. Anyway here is what my master page contains...

Code:
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="TemplateMonster.master.cs" Inherits="RD.TheBeerHouse.UI.TemplateMaster" %>
<%@ Register Src="Controls/ThemeSelector.ascx" TagName="ThemeSelector" TagPrefix="rd" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
    <title>TheBeerHouse</title>

</head>


<body>
    <form id="Main" runat="server">


    <div id="header">
        <div id="header2">
            <div id="headermenu">
                <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" StartingNodeOffset="0" />
                <asp:Menu ID="mnuHeader" runat="server" 
                    CssClass="headermenulink"
                    DatasourceID="SiteMapDataSource1"
                    Orientation="Horizontal"
                    MaximumDynamicDisplayLevels="0"
                    SkipLinkText="0"
                    StaticDisplayLevels="2" /> 
            </div> 
        </div> 


        <div id="loginbox">
            <asp:LoginView ID="LoginView1" runat="server">
                <AnonymousTemplate>
                    <asp:Login ID="Login" runat="server" Width="100%" FailureAction="RedirectToLoginPage">
                        <LayoutTemplate>

                            <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                <tr>
                                    <td width="60px">Username:</td>
                                    <td><asp:TextBox ID="UserName" runat="server" Width="95%" /></td>
                                    <td width="5px" align="right"><asp:RequiredFieldValidator ID="valRequireUserName" runat="server" SetFocusOnError="true" Text="*" ControlToValidate="UserName" ValidationGroup="Login" /></td>
                                </tr>
                                <tr>
                                    <td>Password:</td>
                                    <td><asp:TextBox ID="Password" runat="server" TextMode="Password" Width="95%" /></td>
                                    <td width="5px" align="right"><asp:RequiredFieldValidator ID="valRequirePassword" runat="server" SetFocusOnError="true" Text="*" ControlToValidate="Password" ValidationGroup="Login" /></td>
                                </tr>
                            </table>

                            <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                <tr>
                                    <td><asp:CheckBox ID="RememberMe" runat="server" Text="Remember me" /></td>
                                    <td align="right"><asp:ImageButton ID="Submit" runat="server" CommandName="Login" ImageUrl="~/images/go.gif" ValidationGroup="Login" /></td>
                                </tr>
                            </table>

                            <div style="border-top: solid 1px black; margin-top: 2px">
                                <asp:HyperLink ID="lnkRegister" runat="server" NavigateUrl="~/Register.aspx">Create new account</asp:HyperLink><br />
                                <asp:HyperLink ID="lnkPasswordRecovery" runat="server" NavigateUrl="~/PasswordRecovery.aspx">I forgot my password</asp:HyperLink>
                            </div>

                        </LayoutTemplate>
                    </asp:Login>
                </AnonymousTemplate>


                <LoggedInTemplate>
                    <div id="welcomebox">
                        <asp:LoginName ID="LoginName1" runat="server" FormatString="Hello {0}!" /><br />


                            4
                            <asp:HyperLink ID="lnkProfile" runat="server" Text="Edit Profile" NavigateUrl="~/EditProfile.aspx" />
                            3<br />
                            4
                            <asp:LoginStatus ID="LoginStatus1" runat="server" />
                            3

                    </div>
                </LoggedInTemplate>
            </asp:LoginView>
        </div> 

        <div id="themeselector">
            <rd:ThemeSelector id="ThemeSelector1" runat="server" />
        </div>
    </div> 



    <div id="container">
        <div id="container2">

            <div id="rightcol">
                <div class="text">Some Text</div>
                <asp:ContentPlaceHolder ID="RightContent" runat="server" />
            </div>

            <div id="centercol">
                <div id="breadcrumb">
                    <asp:SiteMapPath ID="SiteMapPath1" runat="server" />
                </div>

                <div id="centercolcontent">
                    <asp:ContentPlaceHolder ID="MainContent" runat="server">
                        <p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p>
                        <p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p>
                    </asp:ContentPlaceHolder>
                </div>
            </div>

            <div id="leftcol">
                <div class="sectiontitle">
                    <asp:Image ID="imgArrow1" runat="server"
                        ImageURL="~/images/ArrowR.gif"
                        ImageAlign="Left" hspace="6" />Site News
                </div>

                <div class="text"><b>7 August 2008 :: News Header</b><br />
                    Other news text...                
                </div>

                <asp:ContentPlaceHolder ID="LeftContent" runat="server" />

                <div id="bannerbox">
                    <a href="http://www.templatemonster.com" target="_blank">
                    Website Template supplied by Template Monster, a top global provider
                    of website design templates<br /><br />
                    <asp:Image runat="server" ID="TemplateMonsterBanner"
                        ImageUrl="~/images/TemplateMonster.jpg" Width="100px" />
                    </a>
                </div>
            </div>
        </div>             


            <div id="footer">
                <div id="footermenu">
                    <asp:Menu ID="mnuFooter" runat="server"
                        style="margin-left:auto; margin-right:auto;"
                        CssClass="footermenulink"
                        DataSourceID="SiteMapDataSource1"
                        Orientation="Horizontal"
                        MaximumDynamicDisplayLevels="0"
                        SkipLinkText=""
                        StaticDisplayLevels="2" />
                </div>

                <div id="footertext">
                    Copyright &copy; 2008 Rob Denham &amp
                    <a href="http://www.baseballmanchester.co.uk/" target="_blank">Baseball Manchester</a><br />
                    Website Template kindly offered by 
                    <a href="http://www.templatemonster.com" target="_blank">Template Monster</a>

                </div>
            </div>

    </div>
    </form>
</body>
</html>


 
Old August 14th, 2008, 07:45 AM
Lee Dumond's Avatar
Wrox Author
 
Join Date: Jan 2008
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

You need to include the following JavaScript in the <head> secion of Template.master:

<script type="text/javascript">
    /* <![CDATA[ */
        function AdjustColumnsHeight()
        {
            // get a reference to the three DIVS that make up the columns
            var centerCol = window.document.getElementById('centercol');
            var leftCol = window.document.getElementById('leftcol');
            var rightCol = window.document.getElementById('rightcol');
            // calculate the max height
            var hCenterCol = centerCol.offsetHeight;
            var hLeftCol = leftCol.offsetHeight;
            var hRightCol = rightCol.offsetHeight;
            var maxHeight = Math.max(hCenterCol, Math.max(hLeftCol, hRightCol));
            // set the height of all 3 DIVS to the max height
            centerCol.style.height = maxHeight + 'px';
            leftCol.style.height = maxHeight + 'px';
            rightCol.style.height = maxHeight + 'px';
            // Show the footer
            //window.document.getElementById('footer').style.vis ibility = 'inherit';
        }
        window.onload = function() { AdjustColumnsHeight(); }
    /* ]]> */
    </script>

 
Old August 14th, 2008, 08:01 AM
Registered User
 
Join Date: Aug 2008
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Lee,

Thanks for your response, but i already tried the javascript, and tried it once again just now. I found that a <div> was out of place for one of the containers as it contained the footer, but ive since changed that and it still doesnt work properly. It works, but the layout is incorrect. :(





 
Old August 14th, 2008, 08:22 AM
Lee Dumond's Avatar
Wrox Author
 
Join Date: Jan 2008
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

You'll notice I commented out the line that shows the footer in the javascript, as there's no real need for it.

The issue is that, because the columns are sized with CSS instad of layout tables, they do not expand to the size of the largest one without using DHTML to do that.
This makes center column content that is longer than the leftcol content run over the footer.

As long as the id names are correct, this should work.

You might also want to try this on the footer div: <div id="footer" style="clear: both;" />

Worth a shot, anyways.

P.S. ALSO, make sure you're using the correct CSS file. Especially if you're using the "Chapter by Chapter" code, as the CSS of the "final" version is different.
 
Old August 14th, 2008, 08:33 AM
Registered User
 
Join Date: Aug 2008
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Lee,

Ha, i had the same idea with the footer division clearing the floats, but that didnt work. I've downloaded the code for chapter 4 and just run that and it runs fine, then when i copy the code from chpt 4 master page into mine it still doesnt work properly, which makes me think it's not the master page. So now i've been copying the code over for the other controls too and still cant manage to find out what it is!! So blummin frustrating!

I'm going to keep trying until i find the problem though :(

Also just a quick one, i noticed the code i downloaded for chpt 4 doesnt include the javascript for resizing the divs yet it still works ok?

Thanks.



 
Old August 14th, 2008, 08:38 AM
Lee Dumond's Avatar
Wrox Author
 
Join Date: Jan 2008
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

Make sure to copy the CSS files as well from the working download. As I said, they change from chapter to chapter.

 
Old August 14th, 2008, 08:44 AM
Registered User
 
Join Date: Aug 2008
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Lee, again you read my mind, just as i received your reply i was in the middle of changing the style sheet and now it works ok. I havent a copy of my old so i couldnt say which part it was that was causing the problem.

But hey, at least we know it was the stylesheet :)






Similar Threads
Thread Thread Starter Forum Replies Last Post
chapter 12 modified register.php problem GOUR CHANDRA PAUL BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 June 6th, 2006 03:41 PM
chapter 12 modified register.php problem GOUR CHANDRA PAUL BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 0 April 27th, 2006 02:14 PM
Register Globals File Upload Problem fshequin Beginning PHP 0 April 24th, 2005 11:56 PM
register globals problem nulogix Beginning PHP 4 June 16th, 2004 08:49 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.