 |
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
|
|
|
|

December 29th, 2009, 01:33 PM
|
Registered User
|
|
Join Date: Dec 2009
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|

December 29th, 2009, 01:52 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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
|

December 29th, 2009, 03:53 PM
|
Registered User
|
|
Join Date: Dec 2009
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|

December 29th, 2009, 03:57 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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
|

December 29th, 2009, 03:59 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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
|

December 29th, 2009, 04:12 PM
|
Registered User
|
|
Join Date: Dec 2009
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|

December 29th, 2009, 04:20 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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
|

December 29th, 2009, 04:28 PM
|
Registered User
|
|
Join Date: Dec 2009
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|

December 29th, 2009, 04:38 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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
|

December 29th, 2009, 05:01 PM
|
Registered User
|
|
Join Date: Dec 2009
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
No, I get two vertical banners when first opened.
|
|
 |