Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > BOOK: Beginning ASP.NET 4 : in C# and VB
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 19th, 2011, 12:53 PM
Registered User
 
Join Date: Feb 2011
Posts: 9
Thanks: 1
Thanked 0 Times in 0 Posts
Default Chapter 8 problem displaying sidebar

Great book; using it in a Web Development course at a University.

I had everything through Chapter 8 working beautifully and decided to add another image to the Banner.ascx to give the students a different example. The image was too large, so I deleted it. Since then, the sidebar is 'wrapping' to the left under the cpmaincontent. I didn't change anything else i.e. the css or any code. I did removed the <style> code that was inserted with the image. The background image for the sidebar is also 'gone.' I have recreated the banner control and reinserted it into the master page, all to no avail. I don't know where to look! Thanks for your help. How do I paste a screen shot?
Reply With Quote
  #2 (permalink)  
Old February 19th, 2011, 01:15 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi there,

I don't think you can paste screen shots here. But you could upload one here: http://imageshack.us/ and link to it.

Can you also post your code for the page that contained the banner? Also, did you verify that none of your CSS selectors has a changed width? Finally, do you see any in-line styles or embedded styles in your page or controls that you didn't add?

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!
Reply With Quote
The Following User Says Thank You to Imar For This Useful Post:
shilohcoder (February 19th, 2011)
  #3 (permalink)  
Old February 19th, 2011, 01:52 PM
Registered User
 
Join Date: Feb 2011
Posts: 9
Thanks: 1
Thanked 0 Times in 0 Posts
Default Chapter 8 problem displaying sidebar

Thank you for the quick response. I am using monochrome and darkgrey just as they came to me; and I'm sure I didn't make any changes between pasting the new image and deleting it. Here's the source for the banner

Code:
<%@ Control Language="VB" AutoEventWireup="true" CodeFile="Banner.ascx.vb" Inherits="Controls_Banner" %>

<asp:Panel ID="VerticalPanel" runat="server" >
    <a href="http://p2p.wrox.com" target="_blank" runat="server" id="VerticalLink">
    <asp:Image ID="Image1" runat="server" AlternateText="This is a sample banner"
         ImageUrl="~/Images/Banner120x240.gif" />
    </a>
</asp:Panel>
<asp:Panel ID="HorizontalPanel" runat="server" >
    <a href="http://p2p.wrox.com" target="_blank" runat="server" id = "HorizontalLink">
    <asp:Image ID="Image2" runat="server" AlternateText="This is a sample banner"
         ImageUrl="~/Images/Banner468x60.gif" />
    </a>
</asp:Panel>
Here's the vb code

Code:
Partial Class Controls_Banner
  Inherits System.Web.UI.UserControl

  Public Property DisplayDirection As Direction

  Public Property NavigateUrl() As String
    Get
      Dim _navigateUrl As Object = ViewState("NavigateUrl")
      If _navigateUrl IsNot Nothing Then
        Return CType(_navigateUrl, String)
      Else
        Return "http://p2p.wrox.com"  ' Return a default value
      End If
    End Get
    Set(ByVal Value As String)
      ViewState("NavigateUrl") = Value
    End Set
  End Property

  Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    HorizontalPanel.Visible = False
    VerticalPanel.Visible = False
    Select Case DisplayDirection
      Case Direction.Horizontal
        HorizontalPanel.Visible = True
                HorizontalLink.HRef = NavigateUrl

      Case Direction.Vertical
        VerticalPanel.Visible = True
                VerticalLink.HRef = NavigateUrl
    End Select
  End Sub
End Class
I will upload the screen shot as well.

Again, thank you!
Reply With Quote
  #4 (permalink)  
Old February 19th, 2011, 02:00 PM
Registered User
 
Join Date: Feb 2011
Posts: 9
Thanks: 1
Thanked 0 Times in 0 Posts
Default Chapter 8 problem displaying sidebar

Here's the link to the screenshot.
http://img197.imageshack.us/i/shiloh...creenshot.jpg/
Reply With Quote
  #5 (permalink)  
Old February 19th, 2011, 02:05 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Could it be that you're assigning the wrong DisplayDirection (or none at all) to the banner? Looks like this left column actually contains the Horizontal, not the Vertical banner.

Check the code that sets up the banner below the theme drop down. It should have its direction set to Vertical.

Hope this helps,

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!
Reply With Quote
  #6 (permalink)  
Old February 19th, 2011, 02:22 PM
Registered User
 
Join Date: Feb 2011
Posts: 9
Thanks: 1
Thanked 0 Times in 0 Posts
Default Chapter 8 problem displaying sidebar image

Thank you, I didn't have a direction selected. That fixed it. I'm still wondering why the image for monochrome sidebar has disappeared. Here's the sidebar description in the css. The image is located in the App_Theme/Monochrome folder and I even copied it to the root, as well.

font-size: 0.8em;
color: White;
background-image: url(Images/Sidebar.jpg);
background-repeat: no-repeat;
background-color: #7773A1;
width: 142px;
min-height: 500px;
padding-top: 10px;
padding-bottom: 10px;
padding-left: 20px;
float: left;
Reply With Quote
  #7 (permalink)  
Old February 19th, 2011, 07:50 PM
Registered User
 
Join Date: Feb 2011
Posts: 9
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Nevermind last; I think I messed up the monochrome css somewhere along the way; a new copy fixed that image problem. Thanks again for your help!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Left Sidebar Dr.T. BOOK: Professional WordPress 1 March 11th, 2011 06:15 AM
Resizing the sidebar Gudni BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 5 December 18th, 2010 01:53 PM
Chapter 6: Sidebar Goes Here CSharp0101 BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 2 April 13th, 2010 03:31 AM
How do you position the Sidebar at absolute top-right? saidrad BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 11 April 12th, 2009 07:42 AM
Sidebar loading through reflection? bmains C# 2005 0 October 20th, 2005 10:21 PM



All times are GMT -4. The time now is 09:23 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.