Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 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 Display Modes
  #1 (permalink)  
Old December 18th, 2009, 02:28 PM
Authorized User
 
Join Date: Dec 2009
Posts: 13
Thanks: 1
Thanked 0 Times in 0 Posts
Default Chapter 8:User Control

Hi,
I am a beginner in ASP.Net and i am glad that i found the right book for me.
Currently, i am working on chapter 8, and i am on page 283(implementing the NavigateUrl property) .I am trying to add code to the code behind of AboutUs.aspx, where i get an error, that "Banner1 does not exist in current context". here is the code.

Code:
public partial class AboutUs : BasePage
{

    protected void Page_Load(object sender, EventArgs e)
    {
      if (!Page.IsPostBack)
      {
        Banner1.DisplayDirection = Direction.Vertical;
        
      }
    }
}
I also checked the ID of Banner in masterpage and it is the same as Banner1. Also everything before this seem to work perfectly fine. Could you pls let me know, where am i making mistake?

thanx!
Arya

Last edited by Arya; December 18th, 2009 at 02:31 PM.
Reply With Quote
  #2 (permalink)  
Old December 18th, 2009, 03:18 PM
Imar's Avatar
Wrox Author
Points: 67,578, Level: 100
Points: 67,578, Level: 100 Points: 67,578, Level: 100 Points: 67,578, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,268
Thanks: 66
Thanked 1,428 Times in 1,408 Posts
Default

Hi Arya,

Good to hear you like the book.

Did you also add the Banner control to the About page? The code in the code behind is using a Banner control defined in that page, not the one in the Master page (as it's not accessible from a page).

Hope this helps. If not, please post the Markup for the About page as well.

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!
Reply With Quote
The Following User Says Thank You to Imar For This Useful Post:
Arya (December 18th, 2009)
  #3 (permalink)  
Old December 18th, 2009, 04:37 PM
Authorized User
 
Join Date: Dec 2009
Posts: 13
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Thank you Sir, for your prompt reply.
Now i got the point. I added Banner to to AboutUs.aspx. and then changed ID in code behind according to it. It solved an error.
thanx again
Arya
Reply With Quote
Reply


Thread Tools
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
Dynamic Add User Control To The Tab Control cheer ASP.NET 3.5 Basics 1 February 25th, 2009 10:48 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 09: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 07:24 AM
Add Windows User control in Web User Control agarwalvidhu C# 0 March 30th, 2006 01:17 AM



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


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