Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
This is the forum to discuss the Wrox book Beginning ASP.NET 3.5: In C# and VB by Imar Spaanjaars; ISBN: 9780470187593
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 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 December 29th, 2009, 01:33 PM
avs avs is offline
Registered User
 
Join Date: Dec 2009
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 8 User control

In the Try it out beginning on pg 279, I have run into a minor issue. When setting the control to display the horizontal banner, it displays nothing. After alot of debugging, I found that the only way to get this to display was to change the width of the pagewrapper in the css from 844px to something much bigger (like 1844px) then it works perfectly. I really do understand what the code is doing and it does work with this page size so it appears as if the browser displays nothing if it can't display the full banner. Clearly this is no big deal, and I do understand whats happening, but for future reference is there a way to say "display as much of the image as you can" rather than "display nothing if it doesn't fit"? I can see where this might be one of those hidden little "gotcha's" that might crop up. For instance, what if I used that exact code but the images I used were created dynamically, and one of them was "too big"? Again, not an issue, just a question for education. OS is Vista Ultimate and IE 8 Thanks
 
Old December 29th, 2009, 01:52 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Can you show me the code where you placed the banner? Sounds like you placed it incorrectly, in a place where it doesn't fit.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old December 29th, 2009, 03:53 PM
avs avs is offline
Registered User
 
Join Date: Dec 2009
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

from the masterpage.master:

Code:
    <div id="SideBar">
        Select a theme
        <asp:DropDownList ID="lstPreferredTheme" runat="server" AutoPostBack="True" 
            onselectedindexchanged="lstPreferredTheme_SelectedIndexChanged">
            <asp:ListItem>Monochrome</asp:ListItem>
            <asp:ListItem>DarkGrey</asp:ListItem>
        </asp:DropDownList>
        <br />
        <br />
        <br />
        <Wrox:Banner ID="Banner1" runat="server" DisplayDirection="Horizontal" />
    </div>
Again, simply making the pagewrapper width larger fixes the problem
 
Old December 29th, 2009, 03:57 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi again,

Take a look at this:

Code:
<Wrox:Banner ID="Banner1" runat="server" DisplayDirection="Horizontal" />
Inside the Sidebar, the banner is supposed to be placed vertically instead. The horizontal one won't fit (by design) in the Sidebar. That's (besides showing how to work with properties on a UC) the sole reason for the DisplayDirection property: Vertical in the Sidebar, Horizontal in content pages...

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old December 29th, 2009, 03:59 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

BTW: you may want to look at the CSS overflow property with a value of hidden. This "clips" off content that doesn't fit in a container.

http://www.w3schools.com/Css/pr_pos_overflow.asp

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old December 29th, 2009, 04:12 PM
avs avs is offline
Registered User
 
Join Date: Dec 2009
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I guess we are on different planes here...
I understand that the vertical banner is supposed to be displayed in the sidebar, and if I set the DisplayDirection to vertical it fits fine and is displayed. I also understand that when the display direction is set to horizontal, the horizontal banner will not "fit" in the sidebar. However the book at least IMPLIES that when I set the display direction to horizontal, I should see SOMETHING, even if its not the whole image, or even if it extends past the edge of the sidebar area. Bullet 9 pg 281 "Note that the right sidebar area now contains the horizontal image, breaking the layout a little because the image is too wide for the sidebar area".
My point is NO image is displayed when set to horizontal. I don't even see the first x pixels of the image, whatever might fit, nor does it display past the edge of the sidebar.
 
Old December 29th, 2009, 04:20 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

We're on the same plane, but it was a little noisy so I didn't hear you quite well ;-)

What happens when you go here: http://www.planetwrox.com/

I temporarily switched the banner to Horizontal. Do you see it? I do when I view it in IE 8. If you don't see it, what browser are you using? If you do see it, you must be using different HTML or CSS than the book's code does. In that case, can you post the relevant code?

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old December 29th, 2009, 04:28 PM
avs avs is offline
Registered User
 
Join Date: Dec 2009
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I do see it when I go to the wrox site, and yes, I am using IE8. Thanks for the help but I don't know what code you want me to post. I believe I've followed the code exactly as it is in the book, and its simply not worth trying to make something work thats wrong to begin with.
 
Old December 29th, 2009, 04:38 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

There has to be a difference somewhere .... ;-)

If you want to figure it out (and learn *why* it's not displaying in the first place), you can post the final HTML (from the browser) of the About page and the code from the relevant CSS files that are in place (which may depend on the theme you're using).

Just to make sure this is not something silly: does the horizontal image display correctly on the About page?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old December 29th, 2009, 05:01 PM
avs avs is offline
Registered User
 
Join Date: Dec 2009
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

No, I get two vertical banners when first opened.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 8:User Control Arya BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 2 December 18th, 2009 04:37 PM
Chapter 9 pps 314-316 Contact Form User Control Featheriver BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 1 February 2nd, 2009 03:19 AM
FileUploader user control chapter 5 psychonet BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 June 5th, 2007 08:18 AM
Chapter 10 User Control Problem sookarama BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 5 October 16th, 2006 06:24 AM
Add Windows User control in Web User Control agarwalvidhu C# 0 March 30th, 2006 01:17 AM





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